Then save it as a template again by pressing Ctrl+ S. Change the sections on the new template that will be on every brochure, such as the logo, or contact information. (This example uses the CentimetersToPoints function to set the values you could use other functions such as InchesToPoints, if desired.) The macro ends up by displaying the Envelope and Labels dialog box so you can make any last minute changes before printing or creating your envelope.5. You can customize these properties as needed or simply omit them.
This is done in the With ActiveDocument.Envelope section. Once an envelope exists in the document we then change the default properties of the envelope. Next the IsError function determines if an envelope already exists if one doesn't, a new one is inserted and EnvThere is set to tell us to delete it once we have changed the default properties. The macro grabs the current selection and uses it as the envelope address if no other address has already been defined. To use this macro, first select the address you want used on the envelope. With Application.Dialogs(wdDialogToolsCreateEnvelope) ReturnAddressFromTop = CentimetersToPoints(2) ReturnAddressFromLeft = CentimetersToPoints(2) AddressFromLeft = CentimetersToPoints(5) The macro will copy the address to the Clipboard, paste it at the proper place in a new document based on the Envelope template, print the envelope, and then close the envelope document without saving it.Ī different approach is to use a macro to set the standard (meaning, those you want to use most often) envelope settings for you. To print an envelope, highlight the address in a letter then click on the Toolbar button with which this macro is associated. Selection.PasteSpecial DataType:=wdPasteTextĪpplication.PrintOut Range:=wdPrintCurrentPage
Selection.MoveLeft Unit:=wdCharacter, Count:=2 Then, create the following macro and assign it to a Toolbar button:ĭocuments.Add Template:="Envelope", NewTemplate:=False Add this envelope to the blank document, and then save it as a template using a descriptive name (such as Envelope.dot). For instance, you can start with a new, blank document, and create an envelope that is just the way you want it to be. You can also use a solution that uses a macro to create your envelopes. Now, the next time you use a document based on the Normal style, the envelope settings will reflect those you created in these steps.
This selects all the envelope information that was just added to your document by Word. This inserts an envelope in your template (which you have open, remember?).