Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2014 by Barry MacDonnell. All Rights Reserved.

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)

Download CUSTOMENV.ZIP
(04/08/10; v1.0; 26,886 bytes)

Compatible with WordPerfect 9 and later versions

(Archival versions: WP6 and WP8)

WordPerfect 11 users: See important information about using macros in the first release of WP11 (11.0.0.233) at the top of this page.

Downloading, Documentation, Modifications, and Support

Disclaimer, Distribution, and Privacy Policies

Alternatives -

  • An alternative to these macros is Mike Koenecke's envelope macro (Shareware).
  • Use a QuickWord (only for WP8 and later) to insert the custom return address (i.e., grapics, font changes, etc.) in the WP envelope dialog. You won't get the personal message stamps that these macros provide, but you will get your desired formatting in the return address area. (For an "envelope message stamper" macro, see here.)
  • Addr2UP ("Convert address to upper case") is a macro that inserts the current letter's mailing address (stripped of certain punctuation marks) in WordPerfect's Format, Envelope dialog in UPPER CASE letters, to conform with suggested postal service guidelines. Addr2UC doesn't format the return address, but you can use the QuickWord technique above to set up your return address formatting, and then play this macro while in your letter. (Addr2UC is based in part on macro code from CSTENV90.)

Related macros -

  • EnvStamp ("Envelope message stamper") - This macro quickly stamps a custom or standard message (e.g., "CONFIDENTIAL") near the bottom of an appended envelope, adjacent to the left margin. The page is usually an envelope page appended to the current document, but it can be an any document page where such a message stamp is needed. (Alternative: You can include a message stamp directly on the template used with the CUSTOMENV macro.)
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.

You will need to have a custom envelope template saved on your computer before using this macro. Even if you have such as 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.)

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.)

Brief background

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.)

Tips

What is a "mailing address" to the WordPerfect program?

See http://wptoolbox.com/tips/MailingAddress.html.

Need to insert a special message on the envelope (e.g., PERSONAL; INVOICE ENCLOSED; etc.) ?

See the EnvStamp macro at http://wptoolbox.com/library/EnvStamp.html. (Alternative: You can include a message stamp directly on the template used with the CUSTOMENV macro.)

Need more than one envelope for a letter?

You can get multiple envelopes for different mailing addressees by selecting the various recipient address block first, then appending each block to the end of the letter by playing the macro once for each block. (You can always delete these appended pages.)

Want to automate some more?

If your letter document's template contains an (optional) user-embedded InsideAddress bookmark, the macro will automatically look for it and, if found, it will grab the line of text immediately to the right of this special bookmark (i.e., your letter's recipient) and up to 5 lines below it, up to the first blank line ending with a hard return.

You can create this optional InsideAddress bookmark so that it is used in all your letters by editing your letterhead template, positioning your insertion cursor at the proper spot, and then selecting Tools|Bookmark|Create and entering it as InsideAddress (exactly as shown: upper and lower case, no spaces). This method may improve the macro's accuracy in locating the address in some documents.

[N.B.: This is an old method the author has used to speed up searching a document for the recipient's address. (See the code segment just under the IF(?BLOCKACTIVE=0) command.) You should test it before relying on it.]


Page Top