Creating a Listbox of Printers in ActiveFORMz
On an ActiveFORMz page it is often useful to allow the user to select the printer they wish to print to from a ListBox. Here is how to do that.
1. Create a variable to hold your list of printers. For example, AvailablePrinters
2. Use Add Function >> Concatenate and concatenate a new line ( “\n”) character (for later use in listbox) to this variable
3. Create a variable to hold the list of printers for the ListBox display. For example PrintersForListBox.
4. Create a procedure to load the list of printers. For example, “Load Printers for ListBox“.
5. In the Procedure, Add an Action and select “Printer List”.
6. For the Format, you can specify a format type to filter out only printers that use that format, or you can leave it blank to display ALL system printers.
7. Next to Printer Information, Click NEW to map an attribute to a variable. Choose the attribute you want to map (Printer Name, Format, or Device) and select the Variable you want to map to. In this example, we are mapping Printer name to the variable AvailablePrinters. This will create an array in your variable containing all of the options of the attribute you’ve selected.
8. To put this into a usable format for an ActiveFORMz ListBox, you can now use the Bulk Concatenate function to store the values in your variable that will be used to display the printer options in ListBox format. In this example, after the Bulk Concatenate function is used, we store the result in our PrintersForListBox variable.