#1
|
|||
|
|||
VBA code to add watermark in all pages
I am trying to add watermark on every single page of my word document. So far by googling all the post, all the vba code I found they apply watermark only on odd pages, until I found the code in the following post which apply watermark on all the pages despite even or odd.
https://www.msofficeforums.com/word-...watermark.html Thanks to Paul Edstein (macropod), the problem which I am getting is that: till 20 pages it apply watermark correctly after 20 pages I don’t get watermark in any single page. Why is that happening, is there any other dependency on some thing which I am missing in my document after 20 pages. Please reply soon. Thanks in advance. |
#2
|
||||
|
||||
That really depends on what's going on in your document at page 20 and thereafter. Perhaps you have added a Section break at that point and the header isn't linked to the previous Section?
As discussed in the linked thread, the code was written to apply the watermark to the first Section only. If the Section headers are linked, a watermark added to the first Section will appear in all Sections.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
A simple concept like a watermark is WAY more complicated than it should be because:
1. A watermark is a floating graphic stored in a header (or footer) 2. Each section can have up to three different headers 3. Each document could have a very large number of sections 4. Some headers are linked to (copies of) previous sections and some aren't 5. Floating graphics can be placed in any header of any section but VBA treats them as if they are stored only in Section 1's headers. 6. Adding watermarks over the top of other watermarks is bad so any complete macro solution needs to be able to identify and remove existing watermarks too. Microsoft added the Design > Watermark functionality to Word around about v2007+ and this works well on simple documents (without too many section breaks and changes to page setups). However it falls down somewhat when document sections get complicated. Code that puts in Watermarks is pretty time-consuming to create if it needs to deal with all the above issues. It can be done, but code like that is rarely spotted outside of paid jobs since the effort required is usually greater than the goodwill required to create it and then give it away for free.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Watermark not on all pages | treadhead194 | Word | 2 | 04-29-2015 05:25 AM |
Watermark | profitdr123 | Word | 3 | 02-21-2015 01:04 PM |
Background/watermark won't go away | Lea | Word | 6 | 04-07-2014 08:59 AM |
Problems with Watermark | AOsment742 | Word VBA | 14 | 06-08-2012 07:20 AM |
Watermark | saslotteroy | Word | 1 | 04-12-2011 03:52 AM |