?
Solved

Changing printer options w/o user input

Posted on 1998-08-18
5
Medium Priority
?
131 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

777 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