Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change Printer
Message
De
27/02/2002 15:01:03
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
27/02/2002 12:11:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00625774
Message ID:
00625960
Vues:
9
>Hi Agnes.
>
>Now I want to set printer in front of report. I figured out that I need to set printer in front of first run because the settings will change the page (lenght)
>
>How about using wscript.network? Just instantiate it in the init of your form like so:
>
>WITH ThisForm
>  *** Save the default printer
>  .cDefaultprinter = SET( 'PRINTER', 2 )
>  *** Set the combo up to point at the current default printer
>  .cboPrinters.ListIndex = ASCAN( .cboPrinters.aContents, .cDefaultPrinter, -1, -1, 1, 15 )
>  *** Create the WScript.Network object
>  .oNet = CREATEOBJECT( 'WScript.Network' )
>ENDWITH
>
>
>You can populate a combo box with an array of available printers using code like this in the combo's init():
>
>
>*** Get the installed printers into the combo box
>APRINTERS( This.aContents )
>This.Requery()
>
>
>Then code like this in the combo's valid:
>
>

>*** set the default printer to the selected printer
>Thisform.oNet.SetDefaultPrinter( This.DisplayValue )
>

>
>Al that is left is to reset the printer to the original default printer after you print the report.

Marcia,
do I have Windows scripting host installed for that?

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform