Merge with word

S

SHIPP

I have Access 2003. I want to write some code that will merge data from a
query with Word. Then save the document with a different name. I want this to
be transparent to the user. Currently what happens is the word document
appears on the screen and is waiting for me to do something. I also get a
message saying a query is about to be run and I have to answer that message.
How can I bypass the message coming up and just create a document and save it?


Set objWord = GetObject("c:\JudgeRpt.doc", "Word.Document")
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
objWord.ActiveDocument.SaveAs FileName:="zzz.doc",_
FileFormat:=wdFormatDocument
 
Top