Excel MailMerge questions

I have two questions that I am hoping someone can help me with.  I can code
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=”FirstName”
in Word vba and it works fine. However it won’t work when trying to modify a Word document from Excel vba.

To get round the problem I tried to invoke a Word vba macro from Excel vba, with something like
Set wordapp = CreateObject(“Word.Application”)
wordapp.Run “divider”, wb1, dt1
This mechanism is fine when there is only one document open in Word, but fails when there are two Word documents open.

So my two questions are:
1.  Is it possible to run ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=”FirstName” in an Excel macro?
2. Can I get Excel vba to call a macro attached to a Word document when there are more than one Word documents open?

I suppose a third question is where to find this stuff out. Where can I read up about it?

By: Peter Ritchie

Leave a Reply

Your email address will not be published. Required fields are marked *