Macros in Word: Tray Selector a thousand times better

Problems with Macros in Word solved

Tray Selector allows you to add buttons to your ribbon bar to print exactly how you want to in a single click. Get rid of unreliable macros and replace them with reliable easily configurable buttons for extra copies, tray selection, page range selection, envelope support and much more.

Table of Contents

How to Select a Printer Tray with Tray Selector

 
 

Tray Selector makes it simple for you to select a printer tray profile for your documents. Once you have installed Tray Selector, the next time you open Word you will see the Tray Selector ribbon bar. This consists of two buttons, Main and Settings

 

To configure Tray Selector for one-click printing, click on Settings.

 

 

The Tray Selector dialogue box appears. From here you can configure up to twenty different Tray Selector profiles. Each profile, once configured, appears as a button in the Tray Selector ribbon bar, allowing single-click printing of your chosen printer tray selections. Using this method avoids complex and difficult macros in word.

 

Here are some examples of common Tray Selector profiles:

  • Letterhead: Every page is printed on Letterhead paper.
  • Letterhead 1st: The first page is printed on Letterhead, with subsequent pages printed on plain paper.
  • Plain: All pages are printed on plain paper.
  • You can also configure Tray Selector to select printer trays containing coloured paper, envelopes and even labels – all with the click of a single button. No macros in word needed just a simple setup.

How To Configure a Tray Selector Profile Button.

 

Once you have clicked on Settings, click in the Profile Name box. Now type in a descriptive name for your printer tray selection profile that means something to you. 

 

For this example, we are going to use the name Letterhead 1st, as we want a button that, in one click, will print the 1st page on letterhead and every other page on blank paper.

 

Ensure that the Show in Toolbar tick box is checked (this only happens by default in profile 1).

 

Under Select Printer, click on the drop-down arrow and select the printer to use for this profile button (all printers you have installed will appear in the dropdown list). The available paper trays for that printer now appear under the First Page and Other Pages boxes.

In the First Page box, select the printer tray from which you want the paper for the first page of your letter/document to come. In this example, our headed paper is stored in the “Tray 1” tray – yours may be different.

 

In the Other Pages box, select the printer tray from which you want the subsequent pages of your letter/document to come. In this example, we want plain paper for our other pages, which is stored in our “Tray 2” tray – again, yours may be different.

Click OK and your button is setup. Each time it is clicked it will send page 1 to Tray 1 and other pages to Tray 2. By selecting different tabs at the top of the settings dialog you can setup up to 20 different buttons. Say goodbye to macros in word for all your printer tasks.


How to use the Tray Selector button(s) you have created

 
 

Once you have setup a button profile using the settings button click OK and you’ll see your button on the ribbon bar. Simply click this button and your current document will be printed in the way you setup. This provides a one click short cut to print over and over again in the way you have pre-set. No need for macros in word just click the Tray Selector buttons.


Set up additional Tray Selector profile buttons

 

You can have up to twenty different Tray Selector profile buttons for any printer tray selections that you may require. Each of these profiles creates a button in Word to let you print to your chosen combination of paper trays with a single mouse click.

 

Create an additional Tray Selector profile, click on Settings again, then the Profile 2 tab, and then follow the instructions above to configure your profile. Note that if you have more than one printer, you can allocate different profiles to different printers – just select the appropriate printer from the drop-down menu.

N.B. Make sure for any subsequent profiles that you check the Show in Toolbar tick box.


How to make changes to a Tray Selector Profile

From time to time, you may need to make changes to your existing printer tray selection profiles; for example, you may add a new printer to your system. To make any changes, click on Settings, then select the tab of the profile name you wish to make a change to. Make your changes, click on OK, and your changes will be effective immediately.


How to print more than one copy in each printer tray selection profile button.

 
 

You may have noticed that in each profile tab there is a section that allows you to print a number of different copies of the same document (see the picture). By clicking the arrows buttons or typing the number of copies you can change the number of copies to print. Clicking the profile button now will print this number of copies. No need for macros in word to print extra copies just simply setup the number of copies you need.


What if my printer is duplex/two-sided enabled – can I print the first two pages to a particular tray?

 

Yes, you can. By default, Tray Selector will only send the first page to the first selected paper tray and all other pages to a different tray. You can, however, change it so that it will print more than one page to the first tray and the remaining pages to a different tray. To do this, simply click the + and – buttons shown in the picture below. For duplex printing, set this option to 2.

 

Many of our users use Tray Selector with duplex printers. In order to do this, they often add a new printer in the “Add Printers” tab which points to the same physical printer and then name it “….duplex”. They then access the properties of this printer, and turn on the duplex printing so that all pages to this printer will be printed duplex. In Tray Selector, the duplex (and non-duplex) versions of the printer will show in the Select Printer drop-down list, so you can configure profiles to either print duplex or not. This is a very powerful feature of Tray Selector, giving the user single-click access to either duplex or non-duplex printing.

 

If you are printing duplex to letter-headed paper, there is one important step you must carry out. Due to the way that the paper is routed from the paper bin to the stacked output, almost all duplex printers must print on the back side of the page first. This is then flipped over and the front side is printed, and lastly it is output to the collection tray. This means that headed paper must be inserted in the paper bin the “wrong way round” compared with how it is normally placed in the bin if printing non-duplex. This means that if you are printing to headed paper and the paper is placed in the duplex position in the bin, you must always print duplex (even if you only want to print one page).

 

If you want to set up two Tray Selector button profiles – one to print duplex and another to print single-sided on the same printer – then you must make a few changes to your system first. We have produced an online duplex printing tutorial to explain how to do this here.


How to print additional copies to a different printer or tray

Tray Selector allows you to print a second print job to another printer with all the usual printer tray selection options. Using this method, you can set up various advanced printing options – for example printing your documents to a PDF file and as a hard copy to a printer – with a single click.

 

To achieve this, click the “Advanced Copies…” button (as shown below). A new dialogue box will open allowing you to select another printer, tray combination and number of copies to print. By default this feature is turned off. Increase the number of copies from 0 to however many you require to turn it on. You can also select a different or the same printer and chose different tray settings for this extra printer. Once again say adios to macros in word and just use Tray Selector.


Mail merge documents

If you have a Mail Merge document and want to print it using Tray Selector it is quite simple. Setup your Mail Merge document in word and preview it to ensure it is correct in the usual way.

 

Once you are sure your data is correct. At this point do not click finish and merge. Instead click your Tray Selector button. Tray Selector should then automatically recognize that the document is a mail merge and display the dialog box (shown) prompting you to take action.

If you click Each letter then each merged letter of your document will be printed using your Tray Selector settings. Clicking Current letter will just print the current document (i.e. unmerged) and clicking Cancel will print nothing.

 

You can also check the box to turn off the autodetect of mail merge and always print the current document

Registering your license key

 
 

Please watch the video of license registration process below

 

Which printer button is set to which printer profile?

You might forget the number of copies each profile prints or which printer it sends copies to. For a quick reminder, just place your mouse over the profile button and it will show this information as shown. Try doing that with a macro in word!


Print an envelope with the document

 
 

Click the settings button and select the profile from which you want to print an envelope. Click the envelope button on the settings dialog box button. Another dialogue box as shown will appear.

 

 

Check the box to enable envelope printing and select the printer you want the envelope to be sent to. Also select an option to state if you want the envelope dialogue box to be shown before or after the main printing. Click OK.

 

 

Now, when the profile button is clicked it will also show the normal Word envelopes dialogue box allowing you to print an envelope too. Note that the printer used for envelope printing will be the one you selected. The tray used can be changed within the envelope dialogue box, and once you have selected the printer tray you want to use, this will be remembered for all future envelope printing jobs.

Setting Up Watermarks

You can setup Tray Selector to print a watermark on a document when it is printed. This normally appears as semi-transparent text behind the text on each page. Tray Selector will add the watermark, print the document then remove it after the printing has taken place. 
 
To do this click the button shown highlighed below on a profile to show the watermark dialog box also shown below:
 
 
You can then configure your watermark item. Specify the watermark text as the text you want on the page (leave blank for no watermark). Next specify the Opacity this is how dark/faint you want the watermark with 100% being darkest and 1% barely visible. Next the rotation of the watermark 0 degrees is normal horizontal 180 is rotated upside down etc. Next the font size in points. You can then either just center the watermark on the page or else give an offset in points from the top left of the page. There are 72 points in an inch and A4 paper is 8.3 x 11.7 inches. Lastly you can specify if you want the watermark on all pages or just the first page. 
 
It’s also possible in the same way to watermark your exta copies for example if you want to print an extra copy with a “COPY” watermark as shown below:
 
 
A few of things to note. When setting up watermarks its a good idea to print to a PDF printer to get your positioning right and then switch to a real printer afterwards. If using the offset from top left this will be the top left corner of the text before it is rotated so take this into account with your rotations. Lastly, if your document has different first page headers or different even/odd headers Tray Selector will turn these off before adding the watermark so your output might be slightly different. You will see a warning of this. This does not apply for first page only watermarks. 
 
Macros in word exist to do this but there is no need just use Tray Selector.
 

Export Button Settings

You can now export button settings from one user to a registry (.reg) file and then import these settings to a new user. The users must have the same access to the same printers and the printer names must be the same. To do this open the settings dialog box from any print profile as shown below and select the Export tab.




When you click the “Export” button it will promt you to choose a file to save the settings too. This file is a standard .reg file and can be used by any other user to import these button settings. Normally this can be done by just double clicking the file. Please be careful making changes to the registry and always backup a users registry first. If you are not confident making registry changes please consult your IT support company for help.

 Using default printers
 
macros in word
 

By checking the Mask to default printer checkbox shown Tray Selector will try to use your current default printer even if you setup the particular profile button using a different printer. This can be useful if you have a roaming profile and use different printers within a particular office. Please be aware however that the default printer must be able to support the same settings (e.g. same trays ) to the printer you used to setup the original profile. In other words it works best when an office has all the same or similar types of printers. If this is not the case you might experience some unusual behaviour.

Calling macros in word before or after printing

Tray Selector 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. Tray Selector uses a call to Application.Run details hereto run the macros specified. 

 

If you prefix your macro name with a “!” then Tray Selector will use the function CallByName to call the macro details here. This allows 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 TsPrintFromProfile20 exist. Be careful not to create a loop or TraySelector will loop around clicking each profile button.

Clicking Tray Selector buttons and access other functions from your own macros.

The following VBA examples shows how this is achieved along with an example of how to make changes for number of copies etc.

Example 1. Simply click the first Tray Selector button


Sub ClickFirstButton()
    On Error GoTo TsErr
    Set tsModule = Application.COMAddIns("TraySelectorOne.AddinModule").Object
    ' Click the first tray selector button buttons are numbered starting from 1 even if they are not shown on the ribbon/toolbar.
    Call tsModule.ClickProfileButton(1)
    On Error GoTo 0
    Exit Sub

TsErr:
    MsgBox ("Error Calling TraySelector Interface")
End Sub
                    

Example 2. More complex



Sub CallTraySelector()
    On Error GoTo TsErr
    Set tsModule = Application.COMAddIns("TraySelectorOne.AddinModule").Object

    ' Set button 1 to print two copies
    Call tsModule.SetProfileButtonCopies(1, 2)
    ' Set button 1 to have two extra copies
    Call tsModule.SetProfileButtonCopiesExtra(1, 2)
    ' Set the document protect passsword in case the document is protected
    Call tsModule.SetDocumentProtectPassword("secret")

	' Set a page range for the next profile printed (works for all profiles) available from version 1.2.4 upwards
    Call tsModule.SetNextPageRange("2-3")

    ' Click the first tray selector button buttons are numbered starting from 1 even if they are not shown on the ribbon/toolbar.
    Call tsModule.ClickProfileButton(1)

	' Clear the page range set above
    Call tsModule.ClearNextPageRange

    ' set the profile button copies back to 1
    Call tsModule.SetProfileButtonCopies(1, 1)
    ' set the profile button copies for the extra copies back to 1
    Call tsModule.SetProfileButtonCopiesExtra(1, 1)

    On Error GoTo 0
    Exit Sub

TsErr:
    MsgBox ("Error Calling TraySelector Interface")
End Sub

Thanks for your order!

We will process your order and send you your license key and invoice within 24 hours

Please fill out the simple form below and you will be redirected to a download screen to download a zip installer.

*we won’t spam your email, this is just for tracking purposes, don’t worry

BUY TRAY SELECTOR

We have simplified the pricing of Tray Selector and now offer a simple SaaS subscription model which includes all updates and support while subscribed. Please contact contact us for more details. We have also imposed a minimum 10 users per license as the overhead of supporting small numbers of users is too great.

Please fill in the form below to create a new subscription. Once we receive the form we will create and email you a license key as well as an invoice for your first years subscription. The invoice will contain a payment link for your to pay online using our payment partner StripeTM. Once we receive your payment we will extend the license key for a full year.

DOWNLOAD TRAYSELECTOR

Click the button below to download the zip file. Extract to a new folder and run the setup.exe extracted. Further instructions exist in the README file also in the zip. Please contact us if you need help installing or have any questions.

By Clicking the Download button above you agree to our terms and conditions of use