Mailmerge Problem

lynxbci

Registered User.
Local time
Today, 15:06
Joined
Nov 27, 2007
Messages
73
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.
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
 
This really is a Word VBA question. You might get a better response if you post your question in the Word section of the forum.
 

Users who are viewing this thread

Back
Top Bottom