Hello,
I am using Excel and Word 2007. I have a macro that starts in Excel and then moves to Word. I have a list of references in Excel, and then there is a macro in Excel that causes Word to open and automatically run a Mail Merge with those references. The Word document has a logo in the footer, but after running the macro in Word, the logo disappears. Or, I should say it turns into one of those pesky little red Xs. If I simply open the Word document and run the Mail Merge manually, the logo is fine, so I'm assuming this is a problem with the macro. Also, this is a new issue and the macro used to run fine without affecting the logo.
Here is my Excel code:
Sub MergeToWord()
ActiveWorkbook.Names.Add Name:="MyData", RefersTo:="=Sheet1!" _
& Range(Selection, Selection.End(xlDown)).Address
Shell """C:\XXXXXXX\winword.exe"" ""F:\XXXXXXX\referencemergefile.docm"""
End Sub
And here is my Word code:
Private Sub Document_Open()
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
'ActiveDocument.PrintOut
Documents("referencemergefile.docm").Close wdDoNotSaveChanges
End Sub
Anyone have any suggestions?
Thanks,
AJO
Bookmarks