Mail merge

  • Thread starter Thread starter Richard Grene
  • Start date Start date
R

Richard Grene

I do a mailmerge and it works fine for word 2002 but not for Office XP. On
Word 2003, only the template pops up without the merge taking place.The
following is my code.

Thanks,
Richard

wrdApp = GetObject(, "Word.Application")

wrdApp.Visible = True

wrdApp.Documents.Open(sLetterFileName)

If wrdApp.ActiveDocument.MailMerge.State =
Word.WdMailMergeState.wdMainAndDataSource Then

wrdApp.ActiveDocument.MailMerge.Execute()

End If
 
It seems most likely that it's the line...

If wrdApp.ActiveDocument.MailMerge.State =
Word.WdMailMergeState.wdMainAndDataSource Then

....that is failing. I don't have Office XP available, but I'd try running
that code through a Word macro to see if it works. Is the syntax the same?
 
Back
Top