Hello everyone,
I need help for how to set up a word doc on templet so that I can export report or pull data from my Access database through MailMerge to the specified word doc. I can open an empty word doc from Access by using vba code, however, I could not pull the data to the word doc and I got run time erro. Can anybody gives me helps.
the code is at the following:
DoCmd.Hourglass True
If CreateWordObj() Then
With gobjWord
.Visible = True
.Documents.Open "H:\NCASchedule\Applicantletter.doc"
DoEvents
With gobjWord.ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
.Execute
End With
.ActiveDocument.PrintPreview 'Preview
.Visible = True
End With
End If
Thank you
Wei Zhang
I need help for how to set up a word doc on templet so that I can export report or pull data from my Access database through MailMerge to the specified word doc. I can open an empty word doc from Access by using vba code, however, I could not pull the data to the word doc and I got run time erro. Can anybody gives me helps.
the code is at the following:
DoCmd.Hourglass True
If CreateWordObj() Then
With gobjWord
.Visible = True
.Documents.Open "H:\NCASchedule\Applicantletter.doc"
DoEvents
With gobjWord.ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
.Execute
End With
.ActiveDocument.PrintPreview 'Preview
.Visible = True
End With
End If
Thank you
Wei Zhang