Help for PrinterSelectBox class ──────────────────────────────── Present a basic print dialog, and return the selected printer name COM ProgID: RobvanderWoude.PrinterSelectBox ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Properties (Note that all properties are string or integer, no booleans, objects or arrays) │ │ │ ╞══════════════════╤════════════════════════════════════════════════════╤═══════════╤═══════════╤══════════════════════════════════════════════╡ │ Property Name │ Description │ Mandatory │ Read-Only │ Default (Allowed) Values │ ╞══════════════════╪════════════════════════════════════════════════════╪═══════════╪═══════════╪══════════════════════════════════════════════╡ │ captioncancel │ Caption for "Cancel" button │ no │ no │ Cancel │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ captionok │ Caption for "OK" button │ no │ no │ OK │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ debuginfo │ A log of actions for debugging │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ defaultprinter │ The current default printer name │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ errors │ List of errors with current settings │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ fontfamily │ Font family used in dialog │ no │ no │ Microsoft Sans Serif │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ fontsize │ Font size used in dialog │ no │ no │ 10 (6..48) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ left │ Offset of window from left screen border │ no │ no │ Centered (0..screen width - windowwidth) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ literal │ Treat "prompt" as literal string (0=false; 1=true) │ no │ no │ 0: interpret "\t" as tab and "\n" as newline │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ localizecaptions │ Use localized button captions (0=false; 1=true) │ no │ no │ 0: English captions │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ modal │ Modal dialog, i.e. always on top (0=false; 1=true) │ no │ no │ 1: always on top │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ preselected │ The initially preselected printer │ no │ no │ default printer or first in list │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ printercategory │ Show only printers from this category │ no │ no │ All (All, Local, Network, Physical, Virtual) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ selectedprinter │ The printer that was selected when the "OK" │ N/A │ YES │ │ │ │ button was clicked or timeout elapsed; if │ │ │ │ │ │ "Cancel" was clicked, selectedprinter is the │ │ │ │ │ │ default printer │ │ │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ timeout │ Optional dialog timeout in seconds (0=no timeout) │ no │ no │ 0 │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ timeoutelapsed │ Timeout elapsed status (0=false; 1=true) │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ title │ Dialog window title │ no │ no │ DialogBoxes.dll, Version 0.18.1.0 │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ top │ Offset of window from top of screen │ no │ no │ Centered (0..screen height - windowheight) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ Version │ Show this DLL's version │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ windowheight │ Height of dialog window │ no │ no │ 220 (220..screenheight) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ windowwidth │ Width of dialog window │ no │ no │ 400 (400..screenwidth) │ └──────────────────┴────────────────────────────────────────────────────┴───────────┴───────────┴──────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Methods │ │ │ ╞══════════════════╤════════════════════════════════════════════════════════════════════════════╤══════════════════════════════════════════════╡ │ Method Name │ Description │ Requirements │ ╞══════════════════╪════════════════════════════════════════════════════════════════════════════╪══════════════════════════════════════════════╡ │ CheckUpdate │ Check the developer's website for updates │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ Credits │ Shows credits │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ Help │ Returns this help text as plain text, or if optional parameter equals 1, │ │ │ │ as html │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ ListAllPrinters │ Returns as list of all printers │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ ListCategories │ Returns as list of available printer categories │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ ListCategory │ Returns as list of all printers in the selected category │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ ListProperties │ Returns a list of this class' properties as key=value pairs (1 per line) │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ SampleCode │ Returns VBScript sample code for this dialog │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ Show │ Presents a basic print dialog based on the current property values, and │ │ │ │ if "OK" is clicked, saves last selected printer name in the │ │ │ │ "selectedprinter" property (if "Cancel" is clicked, "selectedprinter" is │ │ │ │ default printer). │ │ └──────────────────┴────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────┘ VBScript usage example: ─────────────────────── Set objPrinterSelectBox = CreateObject( "RobvanderWoude.PrinterSelectBox" ) With objPrinterSelectBox .printercategory = "Physical" .top = 200 .left = 300 .timeout = 15 .title = "Select a Physical Printer" WScript.Echo WScript.Echo "Printers to choose from:" WScript.Echo "========================" WScript.Echo .ListCategory( ) WScript.Echo .Show WScript.Echo "Selected printer: " & .selectedprinter WScript.Echo WScript.Echo "Default printer: " & .defaultprinter WScript.Echo WScript.Echo .ListProperties( ) End With Set objPrinterSelectBox = Nothing