| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
|Page updated Apr 8, 2010|
|Custom Envelope Launcher - Launch a custom envelope with the mailing address automatically filled in from your letter's address (or just launch a blank custom envelope ready to type or paste an address)|
Related macros -
Purpose and method
WordPerfect can create a filled-in envelope with Format, Envelope, but it loads its own standard envelope page.
This is a macro for WordPerfect 9 (and later versions) that is designed to copy an inside address (i.e., the recipient's mailing address) from the current document and paste it on a customized envelope set up for this purpose, and allow immediate printing or appending to the bottom of the letter.
The envelope can have a custom return address area with different fonts, graphics, etc., as well as any other custom designs (watermarks, text boxes, etc.) for the rest of the envelope.
The macro uses a similar method to the automatic envelope-creating method WordPerfect uses to find an address on page 1 of your document: It looks for the last block of 3 to 6 contiguous lines of text on the page, where each line ends in a single hard return [HRt] (not a line break) and the entire address block is followed by an empty line (i.e., another hard return). Text inside a table will be skipped.
[N.B.: Lines are only considered "empty" if they do not have characters, WP symbols (Ctrl+W), spaces, punctuation (including hyphens), or tabs. If they have any of these, they are not considered to be empty lines by the macro, so they will be included in the line count of the (presumed) address block. (Be careful about using spaces on lines that should be truly empty.)]
You can also select an address block and the macro will use it instead. Be careful not to select too many lines or they might not fit on the envelope.
Notice that hard returns (Enter key) are needed to end the lines. Line breaks [LnBrk], entered with Ctrl+Shift+L, are often used to end a line or paragraph (or are sometimes included if you paste an address from an outside source). They are useful to set off blocks of text such as a RE: or SUBJ: area so that those blocks will not be seen as addresses by the macro. You can also enclose them in a borderless table, since tables are ignored.
Remember, the macro looks for the last qualified block on the first page—i.e., it looks for hard return codes [HRt] that terminate each of the contiguous lines—so if you have more than 2 lines of RE: or SUBJ: matter below the recipient's address you should use line breaks to terminate those paragraphs (or put them inside a table). This will make them invisible to the macro. (You can always force the macro to use a given block of text by selecting it first.)
The first release of WordPerfect 9 (May 1999) created envelopes by appending an envelope page to the current document (unless it was blank, in which case it simply created an envelope page). You didn't get a choice as you did in earlier versions of WPWin to print or append -- you could only append, then print the page.
This macro gives you both print choices and lets you use envelopes with customized features such as a logo, different fonts, or other custom return address area designs.
[Hint: WordPerfect 8 and later versions let you use a QuickWord in the return address field of the envelope dialog to automatically insert these items. See http://wptoolbox.com/tips/CustomRA.html. However, this macro lets you use an envelope with your own customized layout—in any area of the envelope, not just the return address area.]
Instructions to use the macro
After the custom envelope template has been created and saved (see below), simply open or create a letter. Then, when the recipient's address has been entered in the body of the letter, either (1) play the macro, or (2) select the recipient's address with your mouse or keyboard and then play the macro.
The latter method—selecting the address fiirst—sometimes works better when other items can interfere with the macro's ability to locate the actual address. In fact, if you use a WordPerfect table to contain the address you must select the address in that table cell before playing the macro, otherwise the macro will not see it.
Selecting the address is also slightly faster than the first method, since then there is no need to search the entire page. (See the User Modification Area for an optional setting that will display a brief Please Wait message, which might help users on slower computers.)
Tip: If you play the macro in a new, blank document, it will create an envelope ready for you to type (or paste) the recipient's address. This can be handy to create one or several solitary custom envelopes without having to open or create a letter.
Important: The macro will paste the address on the bottom of the custom envelope—the location you would typically get to with your keyboard using Ctrl+End (or Home,Home,DownArrow with the DOS keyboard). So be sure to set up your custom envelope so that the cursor lands at that end-of-document location when you navigate there with your keyboard. The macro will use the same navigation method.
Modifications: You can open the macro (like any WordPerfect document) and edit the settings in the redlined User Modification Area below the comment areas. You can set the macro to use a specific template (in fact this is required to play the macro), convert the mailing address on the envelope to UPPER case, remove periods and commas from the address, use a postal bar code, etc.
Instructions to create the envelope template
See the "Instructions to create the envelope template" section at the top of the macro's code. (You can open a WordPerfect macro for editing just like any other WordPerfect document.)
What is a "mailing address" to the WordPerfect program?
Need to insert a special message on the envelope (e.g., PERSONAL; INVOICE ENCLOSED; etc.) ?
Need more than one envelope for a letter?
Want to automate some more?