Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best way to set the Default Printer
Message
From
26/01/2004 11:18:14
 
 
To
26/01/2004 10:12:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00870520
Message ID:
00870598
Views:
38
Hi Fernando,

My experience has been that after you setup a new default printer, if you select the new default printer in Word once, then it will continue to default to the new printer from that point on.

>Hi again,
>
>I just made a test using SetDefaultPrinter API call to set the default printer.
>
>It worked fine and set the default printer to the one I specified, as could be checked in Control Pannel/Printers, but when I activate Word, open a document and tell it to print it, the printout goes to other printer: the one that appears in Word's print options dialog. If I do the same (open a document a try to print it) with Notepad, it works as expected: to the just set default printer.
>
>What am I missing?
>
>Thanks,
>
>Fernando
>
>>Hi,
>>
>>Doing a search in messages area I saw both methods (shown below) for doing that. There is one that works better, or is recommended?
>>
>>Assuming:
>>
>>cPrinterName = "PDF995"
>>
>>Method 1:
>>
>>Declare Integer SetDefaultPrinter In WINSPOOL.DRV String @pPrinterName
>>
>>SetDefaultPrinter (@cPrinterName)
>>
>>Method 2:
>>
>>oSetDefPrinter = CreateObject("WScript.Network")
>>
>>oSetDefPrinter.SetDefaultPrinter(cPrinterName)
>>
>>Release oSetDefPrinter
>>
>>TIA,
>>
>>Fernando
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform