Return to the main Watermark page
A few years ago, I attempted to use the watermark macro that came with version 2 of Word for Windows on my machine at work. Unfortunately, the macro had a long list of shortcomings, not the least of which was that it failed to accurately position watermarks when the units of measurement were anything other than inches. Since I live and work in France, that problem alone was enough to render the macro useless to me. Because I did need the capability to print watermarks, I completely rewrote the macro to fit my needs and uploaded the result to CompuServe. Soon after the release of Word 6 for Windows, I started receiving many requests to update my macro. As soon as I had access to WinWord 6, I was able to do this. At the same time, I released a version for Word 6 running on Mac OS. The version available on this web site is a minor upgrade that addresses a design limitation. In previous versions, the macro added a maximum of three PostScript code items to any document depending on the user settings (first page, odd pages, even pages). As some users pointed out, this is not sufficient because many more different headers can appear in a document. The macro now cycles through all headers in the document. The price one pays for this feature is reduced speed of execution, but this only becomes an issue for very long and complex documents. In any event, it is not a matter of choice as there is no other way to make the macro work correctly. The only other change is that starting with version 1.6, Mac and Windows versions run the same macro code: the only difference between the Mac and Windows versions is the way they are compressed for download.
The document that may be downloaded from this site is a template that contains an older version of this text and the Watermark macro. Simply use the Word organizer to copy the macro from this template into another one of your choice (be sure to select a global destination template if you wish to always be able to run the macro. "Normal" is a good choice). If you have an earlier version of Watermark installed, rename or delete it before installing version 1.6. You may also want to add a menu item or toolbar button for instant access to the Watermark macro. If you need help with this, use the "Search for Help on..." option from the Help menu and type "copying macros" into the edit field. By typing " adding menus" or "adding toolbar buttons", you can get instructions on how to do those things.
All default values are set up for my personal convenience and may be changed easily enough by editing the macro code (look for a remark that reads "Set dialog default values"). One caveat: if a long watermark string is used with a large font size, it is possible that the watermark may not fit on the page. This will not generate any errors, but the watermark text will be clipped along the edges of the page. Since the width of the watermark string is only computed by the PostScript interpreter at printing time, there is nothing I can do about this. Simply reduce the font size (or the length of the text) and try again. All other controls should be self-explanatory. If in doubt, experiment! To remove all watermarks, simply leave the text field blank and make sure the Frame box is not checked before clicking OK. The PostScript code fields entered by the Watermark macro will be deleted from all applicable headers.
Within a Word document, PostScript code may be entered into a specially formatted field. When the document is printed, Word sends the contents of this field to the PostScript interpreter in the printer as executable code rather than text to be output. The Watermark macro creates a PostScript code field in the header (or headers) of a document. To see the PostScript code, make sure the Field Codes option in the View Menu is selected. When viewing the header of the document, the code will be visible. Even though the PostScript code may be edited like any text in Word, it is preferable to use the macro to do the job. Why? Because there are times when more than one header needs to be edited. If a document has been set up for a different first page and different odd/even headers, for example, the macro has to place PostScript code into three headers (First, Even, and Odd) if the Watermark is to appear on all pages. Supposing that this has been done and a new Watermark is created with the First Page only option selected, the macro will automatically remove the PostScript fields from those headers where it is no longer required. Watermark will only remove things it has added itself, so if your headers contain other fields (such as page numbers, etc.) they will be safe.
The macro also handles the case where the user has only defined one header and wants a water-mark to appear on the first page only. In this scenario, it is the macro that must create a separate first page header. In doing this, it will copy the original header and paste its contents into the newly created first page header. Then, the PostScript code is only added at the beginning of the new header. To the user, the same information continues to be printed on all headers, exactly as it was before the macro was executed. By the way: keep in mind that Watermark places its text under anything you print normally in Word. This means that if there are graphics on the page, the watermark text will completely disappear under them. C'est la vie...
I should also mention that Watermark adds a bookmark to your document; this bookmark is deleted when the macro finishes its execution. Watermark uses the bookmark so that it can return the cursor to the exact position it was in (including any selection) when the macro finishes. The name of the bookmark is W_M; obviously, you should refrain from using identically named bookmarks in your documents.
Watermark contains one interesting piece of code that may be useful to those who have a need for trigonometric functions from within Word Basic. In order to determine the default angle of rotation, it is necessary to compute the arctangent of the ratio page height / page width. Since the language does not support trig, I am using the following formula to calculate the angle:
This series converges very rapidly for values of x < 1. See the appropriate section in the macro code if you want to know how this formula has been implemented (by the way: raising a value to a power is not supported by the language either).
I have received an unbelievable amount of email regarding Watermark. Most users needed some support or wanted to request enhancements. Many people simply wrote to say that they enjoyed Watermark and that the macro did the job for them. I appreciated hearing from everybody who bothered to write, no matter what the reason. Many questions kept recurring, so I decided to answer some of the most commonly asked ones in this document.
When you edit Watermark with a foreign-language version of Word, you will see that keywords are translated into the language of the Word version you are running. Of course, this doesn not apply to anything that's in quotes. Watermark uses one such string in building the field in which the PostScript code is stored. The string in question begins with PS1$ = "Print \p ". This will not be recognized by the WordBasic interpreter of a foreign language version of Word. For example, with a French version of Word, this string is replaced with "imprimer \p " and all is well. Since I only have access to the French, German, and English versions of Word, I do not know what the corresponding strings have to be for other languages. This is the reason Watermark checks the language and posts an error message if it is anything other than the language that it is supposed to run with.
The reason is that I have to be sure that whatever font I choose is built into the PostScript printer that will be used to print the document. Virtually all PostScript printers include Times, Helvetica, and Courier (usually in addition to the Symbol font which is not interesting for our purposes). That's actually 12 fonts (not including Symbol) because normal, bold, italic, and bold-italic are stored as separate font definitions. It is a simple task to modify the Watermark dialog and macro code to use three different fonts that are built into your printer. For general distribution, I feel I have to stick with something I know everyone has.
Yes it does. Initially, I wasn't sure; having witnessed the evolution of Word for Windows version 2 into version 6 (which broke the macro in several places), I decided to play it safe with version 1.5 of Watermark by checking for the version number and aborting the macro if it was not 6.x. Since then, several users have sent me mail stating that the macro works well if one lets it run (i.e., changes the version check so that it allows the macro to run with version 6 or greater). Since then, I've been able to verify myself that Watermark indeed works with Word 7 for Win95, and so I modified the code to allow Watermark version 1.6 to run with Word 7.
To put it bluntly: if it is up to me, never. The beauty of PostScript is that you can get pretty cool effects by adding just a few bytes to the size of your file. I also believe that Watermark has been somewhat successful because it is so simple. It does only one thing, and it does it well (if I do say so myself). There are other choices if you need to have graphical watermarks.
Oh yes, it did! In order to see the output from Watermark, you need to print your document. The macro actually writes a short PostScript program that is stored in the header(s) of your document. At printing time, this program gets send to your printer and it will execute on the device's PostScript interpreter. The output of the program is a watermark that will appear on your page(s). You can see the program code by choosing the Header and Footer option from the View menu and making sure that the Show Field Codes option (also in the View menu) is enabled.
This should not happen again, but if it does, you may have received the macro by someone who has already run it on another platform (i.e., a Mac if you use Windows or Windows if you have a Mac). You need to "dirty" the macro to set things right again. Sometimes this works, sometimes it doesn't (it depends on the version of Word 6 that "touched" the macro before you received it). To "dirty" the macro, edit it and make an insignificant change (for example, add a space to one of the remark lines). Close the window and save your changes. Now try again. If the problem still exists, you may have to download a fresh copy. Incidentally, the reason for this is that Mac OS and Windows use different PostScript coordinate systems.
I have not been working on any enhancement requests due to time constraints. This does not mean that you should not keep sending me your wish lists. On a few occasions, I have implemented special features for users that needed them. These features were not released, either because they were not fully tested or because they were implemented for one platform only.
If you have questions to ask, bugs to report, comments to make, or enhancement requests to place, you are welcome to contact me by means of the e-mail link at the bottom of this page. Please include the version number and whether you're running under Windows or Mac. Watermark is free, so you may distribute it to whomever you want as long as no money changes hands. All I ask is that you only give away unmodified copies of the template. I hope you find Watermark useful; enjoy it in good health!
Return to the main Watermark page
This page was last modified on November 4, 2002
Send feedback about this page to firstname.lastname@example.org
All contents © 1999-2020 The Kiechles