Click to See Complete Forum and Search --> : how to choose a printer with vb code


Nath
December 6th, 1999, 08:46 AM
I'm working with Access 2000 and the VB that comes with it. On a click button I need to be able to choose witch printer to print on (I've got two). how do I do it with the VB code, I really don't know how to do it and really need it

thank you in advanced.

Rouven Thimm
December 13th, 1999, 10:55 AM
Hi,
I don't know if this is the solution you are looking for, but it works with my Visual Basic 6 :

Dim P as Printer
for EACH P IN PRINTERS
Combo1.AddItem P.DeviceName
'Device Name returns a name for the printer, understandable in opposite to any driver information I have found so far
next



After the user has chosen, you need to set the selected printer as standart, referring to the Printers-Collection:

set P = Printers (Combo1.ListIndex)



Now you are basically done and can work with the properties of this printer.
(At least in VB, I don't know about VBA...)

Nath
December 13th, 1999, 11:02 AM
Thank you for your help
I will try it hope it will work but you know how VBA is fussy and VBA from Access2000 is even more

thank you again
nath