04-19-2013, 06:49 PM
Perhaps wdSendToPrinter for the MailMerge.Destination would work, but I'd need to have the user be able to select the printer.
When I run the following function it just prints to the default printer without prompting:
Function WordMerge
Also, the WINWORD.exe is still running after this function runs. How do you properly close the document? I think it must be the merged document that is staying open...or something.
When I run the following function it just prints to the default printer without prompting:
Function WordMerge
;Open WordDoc, MailMerge with DataDoc, and output formatted MergedDoc
str WordDoc="$desktop$\MailMerge.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(WordDoc)
d.MailMerge.OpenDataSource(DataDoc)
d.MailMerge.Destination= wdSendToPrinter
d.MailMerge.Execute()
d.Close
Also, the WINWORD.exe is still running after this function runs. How do you properly close the document? I think it must be the merged document that is staying open...or something.