0

Please if any one knows how to change the default printer on control pannel-printer and fax permenantly, means when I go out from My VB6 program the default printer I set still as default one.

Thanks and best regards

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by vb5prgrmr
0

Using the common dialog control with the flag of defaultprinter=true is one way. The other is the API...

http://vbnet.mvps.org/index.html?code/system/defaultprinter.htm

http://www.tek-tips.com/faqs.cfm?fid=5479

However, the API seems a bit outdated but checking with MS...

http://support.microsoft.com/kb/266767
http://support.microsoft.com/kb/246772/EN-US/

With Windows NT 4.0 (and earlier versions), you cannot use:
Either SetPrinter or SetDefaultPrinter to set the default printer.
Either EnumPrinters or GetDefaultPrinter to get the default printer.
With Windows NT 4.0, you can use:
GetProfileString to get the default printer.
WriteProfileString to set the default printer.

So, you will need to check for the os to see if it is NT or earlier or Win2k or later to see which set of API's to use.

Good Luck

Edited by vb5prgrmr: n/a

0

I donn't want to use Commmon Dialog, becasue I am printer using DataReport, Is ther any way to change the default printer before dumping to DataReport just once, and keep this default for other printing in the application. Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.