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

applocation.activeprinter problem

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US

Testing part of code for ap. keep getting "Metod or data member not found on Application.Activeprinter. Do I need to check something in tools-references? or what.

Private Sub Command0_Click()
MsgBox "The name of the active printer is " & _
Application.ActivePrinter

End Sub

Thanks in advance

jpl
 
There is no Application.ActivePrinter proprty !

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I need to be able to change the default printer, print a document the reset the original printer as the default printer. I got this code from the web:

Sub PrintToAnotherPrinter()
Dim strCurrentPrinter As String
strCurrentPrinter = Application.ActivePrinter ' store the current active printer
On Error Resume Next ' ignore printing errors
Application.ActivePrinter = "microsoft fax on fax:" ' change to another printer
ActiveSheet.PrintOut ' print the active sheet
Application.ActivePrinter = strCurrentPrinter ' change back to the original printer
On Error GoTo 0 ' resume normal error handling
End Sub

This has problems as I indicated in my original post. If this iss correct, then what is?

Thanks

jpl
 
This code is ExcelVBA, not Access VBA.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Printer management is such a PIA in Access most programmers just dump it to a screen preview and let the user figure it out from there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top