Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you return a printer from Print dialog common control

Status
Not open for further replies.

huzza

Technical User
Oct 23, 2000
55
GB
Hi all,
can any one help. I am working in access 97 and have set up a print dialog common control. I would like to be able to use this to set which printer I am printing from, but I can't find out how to do this.
It currently uses printerdefault = true, but I just want to change the printer and number of copies for the current job (I ended up printing several copies of other things because of this as it changes the default number of copies).
I know you can return the device context with the .hdc property, but how do you use this?
If you can't use this from access then how do you return the printer name? If I can get the printer name back I can use the activeprinter property from words vb (what I'm trying to print is word documents by creating a word object then using printout).
I've looked at using the api call for the comdlg32.dll as there seems to be quite a lot of code examples for this and it seems you can return the name of the printer. However access complains as soon as I try to use the command printer.devicename even though the vb6 references are included. The message it gives is ActiveX component can't create object.
I have VB6, but would rather not rewrite the whole thing in VB (it's a project I've taken over).
Thanks in anticipation,
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top