Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement