Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Mail Merge Question
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Word Mail Merge Question
Miscellaneous
Thread ID:
00399481
Message ID:
00399481
Views:
47
Someone posted the following code to perform a Word Mail Merge from within VFP. If works well except for a couple of things

1) How do I specify the default printer in Word? The MailMerge.Execute makes Word wait for the OK button on the Printer window.
2) Can I make gowordapp.visible = .t. without switching to Word? I am thinking that I have a large and diverse group of users, who have their own mail merge documents. If there is a messagebox in Word and Word is not visible, they are stuck and must force complete my app. With Word visible they could switch over there an get rid of the message box. but i do not want my app to swap over to word.
3) what is the value for wdDoNotSaveChanges?

public goWordApp
goWordApp = createobject("Word.Application")
goWordApp.documents.open(settlement.doc)
gowordapp.activedocument.mailmerge.destination = 1 && to printer
goWordApp.ActiveDocument.MailMerge.Execute
goWordApp.documents.close(wdDoNotSaveChanges)
goWordApp.quit()
release goWordApp

thanks

brenda
Next
Reply
Map
View

Click here to load this message in the networking platform