Solved

Changing printer options w/o user input

Posted on 1998-08-18
5
128 Views
Last Modified: 2010-04-30
I need to be able to edit printer properties without the user intervening.  Specifically, I need to be able to change the network port.  (aka Queue name).  Any help??
0
Comment
Question by:bmullins
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
jsuper earned 50 total points
ID: 1429567
Just use the printer object to change the properties of the default printer.   For example, Printer.port = 2.  Use the visual basic object browser to look at the "Printer" object.  It should be a piece of cake.
0
 

Author Comment

by:bmullins
ID: 1429568
Ok, more clearly,  I need to pull in a list of all installed printers, then change each one individually.  (i.e.  if printer.port = "1" then printer.port = "2").

Sorry should have been more clear
0
 
LVL 1

Expert Comment

by:jsuper
ID: 1429569
Use the Printers collection.  Every printer available to the system is contained in the printers object.  For example...

Dim vPrinter as Printer
For each vPrinter in Printers
   vprinter.port = 2
   '  Any other settings you want to change...
next vprinter

Is that what you wanted?
0
 

Author Comment

by:bmullins
ID: 1429570
Yes, but when I try:   Printer.Port = 2 or Printer.Port = "2" I get "Wrong number of arguments.  I think I'm just going use the loop to read the old port then write the new port to the Registry key:  "HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\" & X.DeviceName, "Port"

Can you not define these properties using a simple Printer.Port = "x"??
0
 
LVL 1

Expert Comment

by:jsuper
ID: 1429571
Unforunately, the printer port is a read only property that returns a string such as "LPT1:" or "LPT2:".  I would try your registry idea and see how it goes.   Good Luck.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

696 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