cannot change default printer with vb net
-
10. prosince 2011 13:49customer can not change default printer in XP operating system with code for API in vb net, it happens only one machine, why?
Všechny reakce
-
12. prosince 2011 7:37Moderátor
Hi SaltBir,
Welcome to the MSDN Forum.
How many printers are installed in that machine? And what is the code for change the default printer? Please provide more details such as this.
On the other hand, if there are serveral printers in the machine, you can try to reinstall them all again. Or reinstall the OS and add the printers.
I hope this well be helpful.
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Označen jako odpověď Mike FengMicrosoft Contingent Staff, Moderator 20. prosince 2011 15:16
-
19. března 2012 6:16
Dear Mike,
Miilions of apologizes for late reach due to some problems, and thanks for your welcome...
Code is below to change default printer (we are using-Microsoft.VisualBasic.PowerPacks.dll NET v9)
DeviceLine = PrinterName & "," & DriverName & "," & PrinterPort
Call WriteProfileString("windows", "Device", DeviceLine)
Call SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, "windows")this results with a message PRINTER ERROR 0.
What is strange other users are not facing this problem in the same network-same printer (may be due different OS or versions of OS).
Thanks a lot.
Best Regards
S.Tarik SALT
-
30. března 2012 13:06reason was DEVICENAME, it could not be get from PRINTERS COLLECTION by code, may be one of them raised error and sent code out, solved by RESUME ERROR ON NEXT, skipping the one that could not be read...