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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer vba reference

Status
Not open for further replies.

stalo

Programmer
May 1, 2001
35
CY
I need to know which vba references to set if I want to use PrtDevMode, PrtDevNames etc. I have my references for ADO and DAO but it does not seem to recognise it.
 
I copied this cde:

Sub listprinters()
Dim devs As devices
Dim dev As device

Set devs = New devices
For Each dev In devs
Debug.Print dev.printinfo
Next dev
Set devs = Nothing
End Sub

and I get the error : User-defined type not defined. If there is no library to set, what could be wrong?
 
The problem is due to the fact that the Devices class is also created in the same book as the code you are using comes from - (Access2000 Developers handbook).
So to use this code you must also have the Devices class code as well.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top