Hi All,
I've found myself stuck with writing code to Mail Merge information from excel to a word document. The VBA manages to open the Word document but fails to excute the process when opening the Source Data (DDE).
Can anyone help me???
Set wordapp = GetObject(, "Word.Application")
Set worddoc = wordapp.Documents.Open("\Word Document Location")
wordapp.Visible = True
With worddoc.MailMerge
.MainDocumentType = wdFormLetters
.OpenDataSource _
Name:= _
"Excel Docum", _
ConfirmConversions:=True, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="Entire Spreadsheet", SQLStatement _
:="", SQLStatement1:="", SubType:=wdMergeSubTypeOther
worddoc.MailMerge.ViewMailMergeFieldCodes = wdToggle
End With
Thanks
Bookmarks