Solved

Printing to another port

Posted on 2000-03-02
1
126 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

895 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

12 Experts available now in Live!

Get 1:1 Help Now