Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting ActivePrinter property in Excel
Message
De
27/04/2004 14:08:06
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00897065
Message ID:
00898634
Vues:
38
Thank You. That is just the information I needed.

>It is a port designation in the Registry. To get for Excel I am using this:
>
>   printer_name=SET("print",2)
>   DECLARE INTEGER GetProfileString IN kernel32;
>        STRING   lpAppName,;
>        STRING   lpKeyName,;
>        STRING   lpDefault,;
>        STRING @GetProfileString_ReturnedString,;
>        INTEGER  _nSize
>
>	_nSize = 4096
>	GetProfileString_ReturnedString = Repli (Chr(0), _nSize)
>
>	lnResult = GetProfileString("Devices", ;
>                                    printer_name, ;
>                                    "#empty#",;
>    			       @GetProfileString_ReturnedString, ;
>                                 _nSize)
>
>    lckeyValue=Left(GetProfileString_ReturnedString, lnResult)
>
>    *port
>   	?substr(lcKeyValue,at(',',lcKeyValue)+1)
>
>
>
>
>>I want to set the activeprinter property in excel so that it will print to the printer the user selected from within my foxpro application. After looking at the value in excel, before attempting to change it, it has the name of the printer and "on Ne06:" this is the port. In VFP5 aprinters would return this information in the second column, now in 8 a text description of the port is returned and excel throws and error and the document isn't printed. Is there a simple way to get this port information in 8?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform