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?
 

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

Back
Top