restore default printer

S

sakuragirl1

I have vb code that gives a user the option to select the printer for
printing a report in access. At the end I change the default printer
back to what
it was. Unfortunately the code I found is for win9x so it is not
working when restoring the default, and I cannot find anything on what
the XP code is.

Win9x code is: Call SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0,
ByVal "windows")

Does anyone know what it is for XP?
 
K

Karl E. Peterson

I have vb code that gives a user the option to select the printer for
printing a report in access. At the end I change the default printer
back to what
it was. Unfortunately the code I found is for win9x so it is not
working when restoring the default, and I cannot find anything on what
the XP code is.

Win9x code is: Call SendMessage(HWND_BROADCAST, WM_WININICHANGE,
0, ByVal "windows")

Does anyone know what it is for XP?

See http://vb.mvps.org/samples/PrnInfo -- specifically, the CPrinterInfo class in
that download.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top