Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Macro in Access to run a Mailmerge

Author  Topic 

Chimpanzee
Starting Member

4 Posts

Posted - 2003-02-25 : 06:11:51
OK. Im creating a macro using this code:

OpenQuery
OutPutTo
PrintOut

on the outputto command I am specifying an existing word doc.

I am new to this and wondered how i get it to merge the data to a word doc because all it is doing is printing off the results of the query in Access form onto the word doc. Any help or suggestions would really be appreciated.





robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-02-25 : 07:25:49
You need to look at the Visual Basic Mail Merge methods in Word, not Access. Access will need to call these methods. Start from the Word side and set up the mail merge there, and walk through recording a macro that performs the merge. When you're done recording, you can examine the code and modify it to fit your needs. Once that's done, you can copy it and put it into an Access module. Just make sure to set a reference to the Word.Application library in the module.

Go to Top of Page

Chimpanzee
Starting Member

4 Posts

Posted - 2003-02-25 : 15:58:39
quote:

cheers mate. Appreciate it.




Go to Top of Page
   

- Advertisement -