Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
word - Mail Merge to New Document
#5
So I'm still stuck on this.

Function WordMerge
Code:
Copy      Help
;Open WordDoc, MailMerge with DataDoc, and output formatted MergedDoc

str WordDoc="$desktop$\LaserJet.doc"
str DataDoc="$desktop$\data.txt"
str MergedDoc="$desktop$\Merged.doc"

WordDoc.expandpath
DataDoc.expandpath
MergedDoc.expandpath

typelib Word {00020905-0000-0000-C000-000000000046} 8.0
Word.Application oApp._create
Word.Document d._getfile(_s.expandpath(WordDoc))

d.MailMerge.OpenDataSource(DataDoc)
d.MailMerge.Destination= wdSendToNewDocument
d.MailMerge.Execute()


;;HOW TO SAVE AS MergedDoc?...


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)