Solved

Printing to another port

Posted on 2000-03-02
1
125 Views
Last Modified: 2010-08-05
I  have 2 printers attached to my machine, (LPT1: and LPT2:). How do I print to LPT2? I do not want to use Open# and Print# statements.
0
Comment
Question by:dmoore2
1 Comment
 
LVL 32

Accepted Solution

by:
Erick37 earned 50 total points
ID: 2578637
Loop thru the Printers collection until you find a printer that meets your requirements:

e.g.

Dim p As Printer
For Each p In Printers
    If (p.Port = "LPT2:") And (p.DeviceName Like "*LaserJet*") Then
        ' Set printer as system default.
        Set Printer = p
        Debug.Print Printer.DeviceName
        ' Stop looking for a printer.
        Exit For
    End If
Next
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now