Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting ActivePrinter property in Excel
Message
From
27/04/2004 14:08:06
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, United States
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00897065
Message ID:
00898634
Views:
39
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?
Previous
Reply
Map
View

Click here to load this message in the networking platform