Knowledgebase: Developer
Application.Activeprinter fails because Ne00 port changes
Posted by Craig Lebakken on 17 June 2008 02:36 PM
Problem:
I use the Visual Basic command Application.ActivePrinter = "Win2PDF on Ne00:" to set Win2PDF as the active printer, but when I try to use it on another computer Win2PDF is on "Ne02" so the assignment fails.  Why does the "Ne00" port change, and how do I set Win2PDF as the active printer without knowing which "Ne00" port number?
Solution:
The "Ne" port is assigned by Windows, and we don't have control over the assignment. It can vary depending on the other printers installed on the PC.

The following page has example VB code that should resolve the problem:

http://www.tek-tips.com/viewthread.cfm?qid=879030

The code loops through all possible values for the "Nexx" port names until the active printer is set.
(4 vote(s))
Helpful
Not helpful

Comments (0)

Copyright 2000-2018 © Dane Prairie Systems LLC. All Rights Reserved. About Us | Privacy Policy | PDF Blog | Site Map