Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-17-2017, 01:18 PM
ChrisOK ChrisOK is offline Remove Watermarks Not in Header Windows 7 64bit Remove Watermarks Not in Header Office 2016
Advanced Beginner
Remove Watermarks Not in Header
 
Join Date: Sep 2016
Posts: 54
ChrisOK is on a distinguished road
Question Remove Watermarks Not in Header

Argh! everything I find is to remove from Headers/Footers - but the big file I'm working with has a "DRAFT" watermark on every page (and it's not in the header/footer) --

Trying to do extractions and it keeps interfering -- need to strip them all out..

Thought Find/Replace might work - but when I clicked the ^g (graphic) code it did not locate any!?!



Tried Advanced find > Find > I selected 'graphics from the SPECIAL drop down list' where it inserted the "^g" symbol - again, it found ZERO results!

Then I tried right-clicking on the drop down arrow in the find area and it provided the word "Graphics" with an icon from another list -- I chose THAT one and it found 62 of them but no way to delete..

No idea why one found and the other didn't -- but hope someone can help advise a fast way to remove all at once based on what I found would work painfully!

I tried recording several diff macros - this is the only method that works:
1- Ctrl+F, then click the tiny drop down arrow next to the search box
2- Choose the "Graphics" icon
(once you do, it highlights the 1st found) and tells you the total found...
(I wish at this point I could "SELECT ALL" but couldn't without deleting content.)
3- From this point, I clicked SELECT OJBJECTS" from the Home>Editing>Select menu, and "SELECTION PANE" -- to be able to see all the pieces that made up that "DRAFT" object.

It appears there are Group #'s assigned to each "Draft" image
and within that Group are 5 "AutoShapes" each with their own number
there's also a Text Box tied to it --

4 - So I found if I go 1 by 1 after the graphics search located them all --
Use the down arrow to move through the search and manually select "SELECT OJBJECTS" from the Home>Editing>Select menu, THEN hit "DELETE" it gets rid of it.

Does anyone know how to clean up this macro code to make it loop until it has deleted all the "Groups" no matter what they're named -- or write it in a way I can manually plug in page numbers within the ALT+F11 code window... Range='s "pages 1:61" ( delete all Groups within this range of pages and by editing it to page 61 it will know to STOP there and not keep trying to run or error out) -- so it can be reused on other documents?

I did find a pattern (if it helps any):
GROUP NUMBER CHANGES BY 6 WITH EACH PAGE ADVANCED
AUTOSHAPE NUMBER is 1 more than Group # and counts +5

Page 1 of the 61 pg doc reflected this in the SELECTION PANE:
Group 362
....AutoShape 363, AutoShape 364, 365, 366, 367
...Textbox 6

Pg 2:
Group 356
....AutoShape 357, AutoShape 358, 359, 360, 361
...Textbox 6

Pg 3:
Group 350
....AutoShape 351, AutoShape 352, 353, 354, 355
...Textbox 5

Jumping to the end of the document, the last page was:
Pg 61:
Group 2
....AutoShape 3, AutoShape 4, 5, 6, 7
...Textbox 1

Here's what worked within the manual macro:
Code:
 
Sub DeleteWatermarksIII()
'
' Macro1DeleteWatermarksIII Macro
'
'
     ActiveDocument.Shapes.Range(Array("Group 362")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
 
     ActiveDocument.Shapes.Range(Array("Group 356")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
 
     ActiveDocument.Shapes.Range(Array("Group 350")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
 
     ActiveDocument.Shapes.Range(Array("Group 344")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
 
     ActiveDocument.Shapes.Range(Array("Group 338")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
 
    ActiveDocument.Shapes.Range(Array("Group 8")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
    ActiveDocument.Shapes.Range(Array("Group 14")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
    ActiveDocument.Shapes.Range(Array("Group 20")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
    ActiveDocument.Shapes.Range(Array("Group 26")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
    ActiveDocument.Shapes.Range(Array("Group 32")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
    ActiveDocument.Shapes.Range(Array("Group 38")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
 
    ActiveDocument.Shapes.Range(Array("Group 2")).Select
        Selection.Delete Unit:=wdCharacter, Count:=1
 
 
End Sub

Here's the code I found that apparently only works IF IN the header/footer area:
(perhaps comparing to it -- might help someone figure best way to accomplish)
Code:
 
Sub RemoveWaterMark()
    Dim strWMName As String
 
    On Error GoTo ErrHandler
 
    ActiveDocument.Sections(1).Range.Select
    strWMName = ActiveDocument.Sections(1).Index
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.HeaderFooter.Shapes(strWMName).Select
    Selection.Delete
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
 
    Exit Sub
 
 
ErrHandler:
    MsgBox "An error occured trying to remove the watermark." & Chr(13) & _
    "Error Number: " & Err.Number & Chr(13) & _
    "Decription: " & Err.Description, vbOKOnly + vbCritical, "Error"
 
End Sub
Reply With Quote
 

Tags
remove watermarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Watermarks Not in Header Can't remove header & footer formatting ... frangipan Word 2 07-11-2014 12:27 PM
Remove Watermarks Not in Header Remove space after table in header melliejane Word 1 03-05-2012 04:09 PM
How to remove this paragraph (line) form the header? Jamal NUMAN Word 1 04-14-2011 06:35 AM
Remove Watermarks Not in Header How do I remove the gap in my header? losty. Word 2 10-05-2010 01:21 AM
How do I remove header and footer captn1 Word 2 09-04-2010 04:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:12 PM.


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