This page was prompted by a question in the Microsoft Office Answers forums from a user who wanted to be able to print an envelope or label for a selected contact in Outlook by merely clicking a button. I replied to that question with a pair of macros from which this page was developed.
Rather than ask users to attempt to reconstruct the Outlook user forms and macro code employed by this function, I have made them available for download.
Extract the files from the zip. The three indicated items can then be imported into the Outlook VBA editor either from its file menu or by dragging and dropping into the project directly from Windows Explorer - see first illustration below.
Although intended for Outlook 2007 to 2016, it should also work in Outlook 2003, though that version will require the Office 2007 compatibility pack.
The ZIP file includes sample envelope and table documents. The envelope document as shown may be edited. If the label document is not of the format you need, create a new label document (see below).
Format the included envelope document as required. The envelope features a docvariable field to place the address. When editing the envelope to suit personal requirements do not delete this field or the process will not add an address to the envelope.
Toggle the field display to hide the field construction (ALT+F9) - or right click the field to toggle field codes
Save the changes to the envelope document retaining the name Outlook Envelope.docx in the My Documents folder and close the document.
For the labels, it is not practical to edit the table. It is much simpler to create a new template.
From the Envelope and Labels function create a new document from the labels tool using your preferred label format.
Save this document as Outlook Label.docx again in the My Documents folder.
This label document does not require the docvariable field employed by the envelope function.
These documents are used by the function to print labels and envelopes. It would have been possible to use the Word envelope and label dialog from the function, but this method was used for speed and convenience.
The macro stores details about the layout of the label document in the registry, to which end it creates a registry entry "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Outlook Envelope\Table" with two sub keys "Rows" and "Columns" . Thus the macro requires that the user has write access to the registry. This registry data is created the first time the macro is run, and is updated every time the label format on the user form is changed. The default values are 3 columns, 8 rows, so for most users this will have to be changed the first time the macro is run to match the values from the envelope document. Thereafter the information will be stored and presented on the form whenever the macro is run.
All that remains is to create a toolbar button to run the macro PrintEnvelope_Label.
The function prints a label or envelope for the selected Contact. If no contact is selected the following error message is presented:
Otherwise the main form is presented with the default option set to Envelope and the current address to be printed shown in the upper window. If the macro is added to the ribbon of the Contacts tab (easily achieved in Word 2010 with the built-in ribbon editor) the above message should never be seen.
Office 2010 and later provides a rudimentary ribbon editor. Office 2007 users should add a button to the QAT (Quick Access Toolbar) . I have shown the button added to the Actions Group associated with the Contacts folder. The ribbon editor does not allow buttons to be added into an existing group, so to achieve that effect you must recreate the whole Actions group with the addition of the button as a custom group, and hide the original Actions group.
Click the Label option button and the label settings are added to the form:
Select the label location to be printed from the lower part of the form as shown above to print a single label. Click the check box at the bottom of the form if you require a full page of similar labels for the contact, which changes the display:
Finally click OK to print with the chosen settings or Cancel to quit.