Hi,
I am struggling to get the following code to work, all i want it to do is open a mailmerge document, and then merge. The Document is set-up and the merge works independently.
The error occurs at 'wddoc.Mailmerge.Execute' because the document opens as a normal document, i do not understand why?
Thanks in advance for any help
I am struggling to get the following code to work, all i want it to do is open a mailmerge document, and then merge. The Document is set-up and the merge works independently.
Code:
Dim wdApp As Word.Application, wdDoc As Word.Document
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If err.Number <> 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Open("J:\Operations\Continuous Improvement\CI Document TEMPLATE ACCESS.docx")
wdDoc.MailMerge.Execute
wdDoc.MailMerge.Destination = wdSendToNewDocument
.........
The error occurs at 'wddoc.Mailmerge.Execute' because the document opens as a normal document, i do not understand why?
Thanks in advance for any help