General information
Category:
COM/DCOM and OLE Automation
Title:
Word Mail Merge Question
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only