Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
word - Mail Merge to New Document
#8
figured it out.

Function WordMerge
Code:
Copy      Help
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)