What is the name of the default printer?

shacket

Registered User.
Local time
Today, 10:07
Joined
Dec 19, 2000
Messages
218
Can anyone give me a code that I could use to find the name (i.e. "HP LaserJet III") of the default printer on the computer?

I have looked up the prtDevMode property and I just can't seem to get it. I only need the name of the default printer.
 
Hi Shacket,

i think the way to go is probably the registry... you can get Dev Ashish's registry reader and under NT you'd be after the HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device entry. I've no idea under 2k or anything else. Seems to be one of those things you can do in vb dead easy(ish) but there's no Global class in VBA,

Hope that's some use

Drew
 
I am running Windows 98, so I don't know if that would help. You are right though, it seems that this should be easy!
 
I found that link and have read it a few times. Something just does not compute (literally and figuratively!)!
 
I just tried this one out and it works and is already coded for you. Here is the link right to the file

DefaultPRT.ZIP, a sample Access 97 project for changing your default printer at runtime. If you're printing, and want to change the output device simply, this code is for you.

The entire page of downloads can be reached here.
 
Thanks. That did it. I tried to cut and paste only the code I thought I needed, but I ended up just importing all 5 modules into my database.
 

Users who are viewing this thread

Back
Top Bottom