04-19-2013, 06:58 PM
figured it out.
Function WordMerge
Function WordMerge
WordDoc.expandpath
DataDoc.expandpath
MergedDoc.expandpath
typelib Word {00020905-0000-0000-C000-000000000046} 8.0
Word.Application oApp._create
Word.Document d._getfile(WordDoc)
d.MailMerge.OpenDataSource(DataDoc)
d.MailMerge.Destination= wdSendToNewDocument
d.MailMerge.Execute()
IDispatch app._getactive("Word.Application")
VARIANT v=MergedDoc
VARIANT save=FALSE
app.ActiveDocument.SaveAs(v)
app.ActiveDocument.Close(save)
d.Close(save)
oApp.Quit