Mail Merge To MS Word from MS Access

G

Guest

From a Sales form in MS Access 2000, I am merging data to an MS Word template
based on a query from MS Access. I am using the following code for the merge:

'Declare an instance of Microsoft Word
Dim Wrd As New Word.Application
Set Wrd = CreateObject("Word.Application")

'Specify the path and name to the Word Document
Dim MergeDoc As String
MergeDoc = Application.CurrentProject.Path
MergeDoc = MergeDoc & "\Tanning Salon Customer Merge Letter With Minutes.dot"

'Open the document template, make it visible
Wrd.Documents.Add MergeDoc
Wrd.Visible = True

At this point in the code, I want to automatically merge the fields in the
Word document instead of using the mouse or keyboard. I am unsure what to do
after the above-mentioned code. Can you help?
I have tried "Wrd.ActiveDocument.Merge (am unsure how to insert the path
since this is a document based on a template) but nothing seems to happen
when the code runs.

Thanks
 

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