Product: LABELVIEW, CODESOFT
Version: LABELVIEW Gold and CODESOFT Enterprise 2014 and Newer
This article explains how to populate a printer selection list using a VB Script and automatically switch the active printer when a user selects a printer from a When Printed variable.
Prerequisite: A When Printed variable named Printer must exist on the label.
Create the Printer Selection List
dim printerList, printer, i
Document.Variables.Item("Printer").PickListUse = true
set printerList = Document.Variables.Item("Printer").GetPickList
for i = 0 to printerList.GetSize
printerList.DeleteValue
next
for each printer in Application.PrinterSystem.Printers
printerList.AddValue printer
next
Document.Variables.Item("Printer").ValueFromPickList = true
Automatically Switch Printers
Document.Printer.SwitchTo Value
