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

printing help.

Status
Not open for further replies.

isdex1

MIS
Joined
Jan 1, 2003
Messages
9
Location
US
What is the easiest way to assign a printer and print a file based on the first statement of the content of the file. Basically, I have setup 4 printers on my computer, I would like to print to a particualar printer based on a key word in the first sentence of the file content. Thanks.
 
Have you done a keyword search here for Printers. There are a few threads that should help you. I saw one, there are probably more that give syntax for listing the printers on a system. You should therfore be able to suss the rest possibly. Regards
 
Here what I use to look for partial printer names. Maybe it willl help if you make "TPA" a variable out of the file:

Code:
Dim prn As Printer

  For Each prn In Printers
      If prn.DeviceName Like "*TPA*" Then
         Set Printer = prn
         Exit For
      End If
    Next

CR_CustomReport.SelectPrinter prn.DriverName, prn.DeviceName, prn.Port
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top