Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-16-2016, 07:31 AM
Ajay2506 Ajay2506 is offline VBA code to add watermark in all pages Windows 7 64bit VBA code to add watermark in all pages Office 2013
Novice
VBA code to add watermark in all pages
 
Join Date: Jun 2016
Posts: 8
Ajay2506 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 06-16-2016, 04:16 PM
macropod's Avatar
macropod macropod is offline VBA code to add watermark in all pages Windows 7 64bit VBA code to add watermark in all pages Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 06-16-2016, 08:33 PM
Guessed's Avatar
Guessed Guessed is offline VBA code to add watermark in all pages Windows 10 VBA code to add watermark in all pages Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code to add watermark in all pages Watermark not on all pages treadhead194 Word 2 04-29-2015 05:25 AM
Watermark profitdr123 Word 3 02-21-2015 01:04 PM
VBA code to add watermark in all pages Background/watermark won't go away Lea Word 6 04-07-2014 08:59 AM
VBA code to add watermark in all pages Problems with Watermark AOsment742 Word VBA 14 06-08-2012 07:20 AM
VBA code to add watermark in all pages Watermark saslotteroy Word 1 04-12-2011 03:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft