
Access -> Word Mailmerge questions
I have a set of Word 97 mailmerge documents. I have a, reasonably large
(30 Mb) Access 97 database.
I am trying to call the Word document as a mailmerge from a query in the
Access database. It works... or so it seems... but:
1) Sometimes it opens another copy of my database. This can be rather
long as it is a big database. I want to force it to use the currently
active and open database. What's "strange" is that sometimes it runs
without opening another copy and sometimes it doesn't... I wish I knew
why!
2) After the mailmerge is done and the user closes Word: Word asks if
they want to save their changes in their newly created document. This
is normal and desired. Word then asks if they want to save the changes
to the mailmerge document which was used. This is what I would like to
avoid. I do not want them modifying the model document nor having the
message. I tried setting the model document as read-only but it didn't
change anything.
My mailmerge function, based on MS KnowledgeBase article Q159328, looks
like this:
public function MergeWord()
dim objWord as Word.Document
Set objWord = GetObject("MYMODEL.DOC", "Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.MainDocumentType = wdFormLetters
objWord.MailMerge.OpenDataSource Name:=CurrentDb.Name, _
ReadOnly:=True, LinkToSource:=True,
_
Revert:=False, Connection:="QUERY
reqWord"
objWord.MailMerge.SuppressBlankLines = True
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
end function
Thank you in advance for your assistance.
/****************************************************
// Paris - FRANCE Web: http://www.*-*-*.com/
/****************************************************