Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to print Word doc to a printer name?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01266578
Message ID:
01266582
Vues:
12
>I have a routine that prints a Word document (from VFP application, of course). But it prints document to a default printer. The segment of the code that prints the document is as following:
>
>
>	oDocument = oWord.Documents.Open( cFile2Attach )
>	if type( "oDocument" ) = "O" and !isnull( oDocument )
>	  oDocument.PrintOut(.F.)
>	  oDocument.Close()
>       endif
>
>
>Where in the above code I can specify where (printer name) to send this document? And what is the syntax?
>
>Thank you in advance for any help

Try:
#DEFINE wdDialogFilePrintSetup 97
lcPrinter = GETPRINTER()

oWord = CreateObject("Word.Application")

WITH oWord.Dialogs(wdDialogFilePrintSetup)
     .Printer              = lcPrinter
     .DoNotSetAsSysDefault = .t.
     .execute()
ENDWITH
Can't test it right now
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform