Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Mail Merge Question
Message
De
01/08/2000 13:50:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00399481
Message ID:
00399487
Vues:
10
To set a printer, use goWordApp.ActivePrinter = "Printer name and port". Word expects the printer name and where it is, so it needs something like "HP LaserJet 4 local on LPT1:". You can get those values from the first and second columns of APRINTERS() in VFP. Unless you have a complicated network setup, you really don't need the "local on LPT1:" part for setting ActivePrinter.

One thing to remember, no matter what your user sets the printer to in your application (maybe using SYS(1037), Word will ignore it and use the Windows default printer unless explicitely told otherwise via ActivePrinter.


>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
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform