raySelector allows you to setup profile buttons that call macros before or after printing. You can define your own macros in files like normal.dot or elsewhere and call them.

On the settings dialog for each profile there is a macros button (the icon is a computer) shown in the picture below.

Clicking this button will open the macros dialog box allowing you to specify a macro that is run directly before and after the printing assigned to that profile button. Only one macro can be called by you but you can of course call other macros from within your user defined macro.

A macro can be called with up to 5 arguments. String or integer arguments can be supplied. Strings should not be quoted.

So for example if you have defined a macro in your normal.dot file as below

Sub AboutToPrint(s As String)
   MsgBox s
End Sub

that you want to call before your profile prints, then you setup your macros in the dialog box as shown below. Clicking the profile button will now first call AboutToPrint with the string “TraySelector” which will display a MessageBox on the screen.

You can call a macro with between zero and 5 arguments. TraySelector uses a call to Application.Run (details here) to run the macros specified. If you prefix your macro name with a “!” then TraySelector will use the function CallByName to call the macro (details here). This alllows maximum flexibility.

You can also chain buttons together to make them call each other. This means that the user only needs to click one button and after the printing has finished, the next button will automatically be called. To do this just call the inbuilt macro TsPrintFromProfile1 to invoke the first button. TsPrintFromProfile1 up to TsPrintFromProfile12 exist. Be careful not to create a loop or TraySelector will loop around clicking each profile button.