A simple script that automates the watermarking of documents in Word.
The below script will automate the process of watermarking documents in Word.
I needed a way to automatically create watermarks on Word documents without any user interaction as part of a larger script.
Although Word has a built in ribbon button for watermarking, I have not been able to find a way to call it in PowerShell. When adding a picture in a document, you are not given the ability to alter the transparency like a true watermark.
In order to add a picture and control its transparency, you have to first create a shape and then fill that shape with an image. Because you can control the transparency of the shape's fill, you can now control the transparency of the watermark image. To make it look like a shape is not even there, the default outlines of the shape should also be hidden/removed.
How to Use:
Save the script as "WordWatermarking.ps1" and run in either one of two ways:
A watermark looks better when the image has no background. If the image used has a background, then you will get the block look which seems unprofessional. Because we are not all image experts, the easiest way to create a watermark image that does not have a background is to use WordArt and shapes in PowerPoint. Simply create the design, select all objects, right click, Save as Picture. This creates a .png file with the background removed that you can use for your watermarks.
The shape does not automatically change size based on the size of the picture. You should adjust the shape size manually below (the 500, 125 numbers) to be the same ratio as the image you are going to use. i.e. if I have a watermark that is 1.6" x .9" (or even 160 pixels by 90 pixels), I would size the shape to be 160 x 90 or 320 x 180 or 80 x 45. This prevents the image from looking like it is being stretched or shrunk.