second request for macro help "on open commands"

D

DA

Hi Cory

The following steps should get you on the right track.

- Open your document.
- Open the VBA editor, double-click on "ThisDocument".
You should see a code window with two drop-downs at the
top. Select the left drop-down and select "Document".
- Now select the "Open" event from the right drop-down.
You'll see that Word inserts a new sub routine called
Document_Open()

- Place any code you want to run when the document opens
inside this routine. To bring up your "mailmerge find"
dialog, call the following:

WordBasic.MailMergeFindEntry

Your auto-update problem needs to be handled in another
routine. It's a little more complex, but also easily
done. You'll have to establish a connection to your
database first. From there you can search for your form
field value and if it's not there you can create a new
record. I suggest you do a bit of reading first (link
below) and give it a go. If you get stuck, just do
another post.

http://word.mvps.org/FAQs/InterDev/GetDataFromDB.htm

All the best,
Dennis

-----Original Message-----
i have word 2002

i have a document that i hooked to an access database
for the customer name then ship to and invoice to fields.
When i open the document i have to click on the "Find
Entry" button on the mail merge toolbar and then type in
the customer name and then it brings up the requested
info.
Is there a way i can write an on open command to have
this "Find Entry" open when the document opens? Also as
long as i am posting is there a way to have the database
auto update when new information is typed into the fields
(i.e. if the customer is not in the database yet)
Any suggestions would be very helpful. I will check
this post a couple times a day so if you need more info
from me just let me know i will post a reply within a
couple hours.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top