Jump to content
Sign in to follow this  

Set Print Preferences Unknown Printer Name

Recommended Posts


I am attempting to set printer preferences for a label printer. Based on what the person has entered in a GUI form I need to change the paper height to match. So far things have gone pretty good but now I have run into this problem:

Some computers have the printer installed by a different name then the default. (i.e. they have plugged it into multiple USB ports hence creating copies of the label printer.) I am wandering if anyone out there knows how to set printing preferences based off a driver name or some other set variable. I tried playing with the /r function of printui.dll but it says it can't find the printer. Here is what I have so far:

Run('rundll32 printui.dll,PrintUIEntry /e /n "ZDesigner RW 420"') ; opens preferences
WinWaitActive("Printing Preferences") ; wait for window to be active
WinSetState("Printing Preferences","",@SW_HIDE) ;hide preferences (seems useless)
$oldheight = ControlGetText("Printing Preferences","","[CLASS:Edit; INSTANCE:3]") ;get current height preference
ControlSetText("Printing Preferences","","[CLASS:Edit; INSTANCE:3]",$height) ;set new height preference
ControlClick("Printing Preferences","","[CLASS:Button; INSTANCE:12]");submit changes

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.