yeah i just realzed the dat on that article.. oops.
yeah.. about it not working, i get no error message, or anything. the report
prints, just on the wrong printer. and the default is not changed.
daniel
Daniel O'Dorisio
dodorisio@h...
xxx-xxx-xxxx
-----Original Message-----
From: Marco Straforini [mailto:marco@c...]
Sent: Monday, July 23, 2001 5:54 PM
To: professional vb
Subject: [pro_vb] RE: Change default printer
Daniel,
setting the Printer object does not change the system default printer,
the Q167735 article is correct. What the article does not explain (it is
quite old, before VB6 and probably before W2K) if it changes the default
printer for the current user of all users.
Because your code does not run in a dll, I presume there is something
different in the hosting application/user. Also, you do not say what is
not working. Do you have the correct list of printers? Do you get any
errors? Try debugging the application step by step, and print the exit
status of all API calls, to find out which one (if any) fails.
m.
> -----Original Message-----
> From: Daniel O'Dorisio (Work) [SMTP:dodorisio@h...]
> Sent: Monday, July 23, 2001 11:52 AM
> To: professional vb
> Subject: [pro_vb] RE: Change default printer
>
> addendum to the last message:
>
> it does work in windows 2000 (the if statement that got the os was the
> problem) so i can get it to work in win2000. but no when i take the code
> out
> of a standard exe and into a activex dll that is accessed through a
> webpage
> (componet services)
>
> thanks
> daniel
>
> -----Original Message-----
> From: Daniel O'Dorisio (Work) [mailto:dodorisio@h...]
> Sent: Monday, July 23, 2001 2:29 PM
> To: professional vb
> Subject: [pro_vb] Change default printer
>
>
> programatically is there a way to change the default printer in windows
> 2000.
> i tried some code from planetsourcecode.com that was based on the ms KB
> article:Q167735
> but it dosnt seem to work on windows 2000 i think it changes a line in the
> win.ini file