Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printers and VFP
Message
From
26/08/1999 11:36:54
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00255437
Message ID:
00257972
Views:
23
>>>>>>>Hi all,
>>>>>>> I have some reports that use @ say commands as opposed to the report writer. Some reports just can't be done with the report writer. I'm trying to add a feature to allow users to select which printer to send reports to. Bsically I'm using the Fox function GetPrinterand making API calls to GetProfileString, WriteProfileString, and SendMessage to change the default printer temporarily, then set it back after the report runs. When I change the printer and use sendmessage to notify all apps that the default printer changes IE, Word, etc.. prints to the correct printer.. BUT VFP doesn't seem to notice I changed printers.. Maybe I'm going at this the wrong way.. not sure.. Help!
>>>>>>>
>>>>>>>TIA!
>>>>>>
>>>>>>Have you tried:
>>>>>>
>>>>>>SET PRINTER TO NAME (GETPRINTER())
>>>>>
>>>>>Yes.. If yuo pick anything other than the default printer it does nothing.. if you pick the default.. it prints fine..
>>>>
>>>>PMFJI: We use @SAY to print checks, and SET PRINTER TO NAME ("&xxx.") to re-direct the printer, and its fine. Don't want to insult you, but are you also doing "SET DEVICE TO PRINT" before and "SET DEVICE TO SCREEN" after? Also, try doing this: xxx = GETPRINTER() then SET PRINTER TO NAME ("&xxx.") - just like this -- macro in quotes and parentheses might do the trick for you.
>>>>
>>>>Beware: GetPrinter() gets the printer by NAME as shown in the Print Manager window -- and is different for different users if they decided to 'rename' their printer icons to 'be more logical' or some such...
>>>>
>>>>HTH
>>>>
>>>>Rob
>>>
>>>I think you should try the common dialog box!!!
>>
>>Hi Emmanuel:
>>
>>Not sure what that would do for me that GetPrinter() does not... I would still need to do the SET DEVICE/SET PRINTER TO/etc. stuff inside the code. Do
>you mean the MS Active-X control? Please explain. If there's an easier way, I'm all ears.
>>
>>Rob
>
>Yes, I mean the MS-ActiveX control. It set the printer you choose as the default printer so you don't have to issue SET PRINTER TO, but you still need a SET DEVICE TO command. If you need help using the common dialog box, let me know.


I finally got all the printer stuff figured out.. My problem was with the Set Printer off/set printer to not allowing me to actually get a dialog up. I found basically what you said in MSDN and it helped me get all my stuff working.. My users are happy now. ; ) Thanks for all the help.
Previous
Reply
Map
View

Click here to load this message in the networking platform