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-2017 by Barry MacDonnell. All Rights Reserved.

Page updated Sep 26, 2015

BACKGROUNDFILL - Create a user-specified "background fill" for the page, extending to outside page margins (or at any desired printable location)

Download BACKGROUNDFILL.ZIP (version 1.0; 08/01/11; 17,232 bytes)

Compatible with WordPerfect X5 and probably earlier versions

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

Downloading, Documentation, Modifications, and Support

Related pages -

To create a line border around the edges of the page, see LineBorders.

To create a border made up of words strung together around the edges of the page, see TextBord.

To create a graphical page border with repeating graphic images (clipart, photos, etc.) using Corel Presentations, click here.

Adding emphasis to text: how to create custom paragraph / page border or fill styles


The BackgroundFill.wcm macro creates a solid background page fill for your document with your choice of color, outside the page margins, on the current page or from the current page forward, according to the specifications of the user (see Modifications below).

[Tip: To temporarily change the color of the screen background in WordPerfect you need to change certain Windows settings. Klaus Pfeiffer has a free Color Manager Macro (WordPerfect 8+) to do it, then return the color back to the default: See WordPerfect Universe here. Note that this is an entirely different thing than the process used, and goal achieved, by BackgroundFill.wcm.]

Computer screen Screen shot of a sample page after playing the macro.

WordPerfect's own Format, Page, Border/Fill does not extend very far beyond page margins (and can vary with changes in margins), whereas this macro can place a filled text box as near the edges of the paper as desired and that the printer can print (as discussed in the Tips section below).

The background fill is created using a text box inside a watermark, so it will show up without interfering with the main document's text, in the user's desired dimensions, and without being impacted by any page margin changes in the document. See Tips below.

Note that if you choose the option to place the background on the current page only, a [Delay: 1] page code is also added to discontinue the watermark on the next page (if there is a next page). So if you wish to delete the [Watermark] code you should delete the associated [Delay] code.

[For more on Delay codes see here.
For more on headers, footer, and watermarks and how to start, stop, suppress, change, replace, delay, overlay, and remove them see here.]


•  Download and place the BackgroundFill.wcm macro on your system (if you need help see "Downloading..." in the left column).

•  Open a document, and play the macro with Tools, Macro, Play.

•  A small dialog will appear with some options. [screen shot]

•  Click OK to create the background fill.

Note that if you play the macro in a blank document nothing will happen: It must contain something for the macro to work.


To change the macro's pop-up menu (and other) defaults, see the redlined User Modification Area in the macro's code (just open the macro like any WordPerfect document to view or edit it).

You can specify -

□  The watermark to use (WatermarkB is the default, but see Caution below if you use Legal Pleadings).

□  Where to place the watermark (current page only or current and following pages).

□  The space around the perimeter of the border (spacing for each of the four borders can be set independently).

□  The color and shade of the box fill.

□  The type and color of an optional border.

Tips, cautions, and alternatives

•  The macro will not do anything in a completely blank document. Add some text (or even just a format code) and then play the macro.

Even though you can use Edit, Undo (or Ctrl+z) to remove the effects of the macro, it is wise to make a backup of the document before playing the macro.

•  You can search and remove one or more existing [Watermark] codes using the Find and Replace, Match, Codes feature.

This works in any WordPerfect document. This might be useful to clean up the document before playing the macro (which uses Watermark B by default) or if you played the macro multiple times (see next tips). You will also want to remove any associated [Delay] codes [Footnote 1] that discontinue the watermark on the next page.

•  Why the background fill does not extend ("bleed") to the very edges of the page:

Printers have "non-printing areas," and this information is part of the printer driver installed on your computer for that printer.

WordPerfect makes heavy use of printer drivers to produce true WYSIWYG on screen. Hence -- and as in the screen shot above -- there probably will be a narrow area around the page(s) perimeter without any fill color (both on screen and on the printout) since that printer cannot print there anyway.

Alternative: If you choose (e.g.) to Publish to PDF or "print" directly (via File, Print) to a virtual PDF printer driver the fill should extend to the edges of the PDF document page (on screen) since the PDF program is not a physical printer and should not have the same mechanical or electronic restrictions with respect to the "printing" area.


◦  Unfortunately, using Publish to PDF or printing directly to an alternative PDF printer to allow the background to "bleed" to the actual edges of the document (on screen) might not work for all page setup sizes (i.e., page definitions) or with some system configuations. You can simply try it and see if it works for you.

◦  If a PDF with a full background fill is then printed (rather than viewed on screen) it will still not bleed to the edges of the page due to the printer's non-printing areas.

•  To make it easy to use, you can assign this macro to a menu, toolbar, or keystroke shortcut: http://wptoolbox.com/tips/EasyPlay.html. You can also turn off the display of the macro's menu with a setting in the User Modification Area; this might be useful if you always use the same watermark, border spacing, etc., and prefer to use the macro without seeing a menu.

•  You can also make several copies of this macro with different borders set in the User Modification Area. (Just open the macro file like any document and read the comments at the top of the macro's file. When done, click Save & Compile on the macro toolbar that should be visible.)

•  If you chose to place the watermark on multiple pages, you can manually stop the borders from continuing on any page by placing your cursor at the top of that page and using Insert, Watermark, [choose A or B, whichever was used for the text box], Discontinue. This is the method the macro uses if you chose the "current page only" option.

•  Using the same watermark type (A or B) on a page will supersede any previous one of the same type (A or B) from that point forward. (For more on headers, footer, and watermarks and how to start, stop, suppress, change, replace, delay, overlay, and remove them: http://wptoolbox.com/tips/HeadFootWM.html)

•  The macro can even be used to create a small empty box to use for stamps, initials, etc. Just set the outside spaces to larger sizes in the User Modification Area or the optional pop up menu. If you then edit the watermark you can add text to the box. (Better yet, see the EdgeText macro here: http://wptoolbox.com/library/EdgeText.html.)

•  To create a border in a matching or contrasting color, see the options in the User Modification Area of the macro's code.

•  If you play the macro with the variable vCurrentPgOnly=1 (located in the User Modification Area)—i.e., it is set to add a box just on the current page—and you play it multiple times on various subsequent pages, the macro will place several [Watermark] codes throughout the document on those pages.

This is generally not a problem since it is the same watermark in all cases (unless you modify the macro's code to adjust the borders for various pages), but remember: Inserting a watermark, header, or footer of the same type (A or B) supersedes the same type of item from that page forward. So if you have other special watermarks in the document, be sure to test the effects of the macro by viewing all pages in that document. (Make a backup of the document before playing the macro.)

But it might make for a "cleaner" document (in terms of fewer extra codes in the document or fewer "misplaced" codes due to editing the document) if you wait until the final draft to play the macro to play it (usually once, but you can reset the border between multiple plays for special effects).

•  Legal pleadings are created using Watermark B. Hence, if you use pleadings you should use Watermark A for this macro. (See the User Modification Area to set the default.)

•  Alternative to this macro: There is a free online Gradient Image Generator that can quickly create a horizontal or vertical gradient fill in your chosen colors. Save the image to your hard drive, then create a Watermark (see here) and insert the image into the watermark with Insert, Graphics/Pictures, From File. Then re-size it to fit the page. Right-click on the image to bring up WordPerfect's Image Tools. You can then flip the image, change the brightness, etc. Here is a screenshot of a sample (in WordPerfect the image actually extends to the right side).

•  Alternative to this macro: You can create a custom horizontal or vertical gradient fill. See Adding emphasis to text: how to create custom paragraph / page border or fill styles.

•  Alternative to this macro: You can create a fill for the current page without using a text box inside a watermark. See this post on WordPerfect Universe.

Footnote 1

Delay codes can be inserted with Format, Page, Delay Codes. Note also that WordPerfect sometimes adds them automatically when it requires that some action should be delayed to a subsequent page -- such as when you choose to stop a watermark on a subsequent page using Insert, Watermark, Discontinue. The program will take care of this with a [Delay] code.

Here's a little more on the topic that might prove useful.

From WordPerfect X6's Help:

"Delay codes allow you to suppress open codes by specifying that the open codes take effect after a specified number of pages. Open codes can include codes for line numbering, fonts, tab settings, and margins. For example, if on page 3 you delay a code by two pages, the code takes effect on page 5.

You can delay any open codes; however, you cannot delay paired codes. Paired codes are codes that have two codes — one at the start of the entry and one at the end of the entry. For example, bold, italics, tables, indent, and alignment codes are paired codes."

Delay codes are actually made up of two codes: the first [Delay] code tells WordPerfect what to do; the second [Delay Codes] code appears on the (delayed) page and tells WordPerfect to start doing it.

You cannot use Find and Replace to search inside [Delay] codes (or [Style] codes, either). You will have to open them manually: Double-click the first code of the pair to open the Define Delay Codes window. Make sure Reveal Codes is open so you can see what is inside the [Delay] code.

Footnote 2

[Previous information (a caveat) is now included above]