-
Remove any Watermark
Hello,
I need a macro to remove the watermark from a Word file (2010).
I have been looking into this but I am not able to create this macro for any watermark, no matter the watermark used in the document.
In other words, what I am looking for is a generic macro that removes the watermarks, without writing in the code the name of the watermark (usually DRAFT, COPY or WHATEVER).
Is this posible?
Many thanks in advance
-
The following should do that (for text watermarks like those mentioned).
Code:
Sub RemoveWaterMarks()
'Graham Mayor - http://www.gmayor.com - Last updated - 08 May 2018
Dim oSection As Section
Dim oHeader As HeaderFooter
Dim oRng As Range
Dim oShape As Shape
For Each oSection In ActiveDocument.Sections
For Each oHeader In oSection.Headers
If oHeader.Exists Then
Set oRng = oHeader.Range
oRng.End = oRng.Paragraphs(1).Range.End - 1
For Each oShape In oRng.ShapeRange
If oShape.Type = 15 Then oShape.Delete
Next oShape
End If
Next oHeader
Next oSection
lbl_Exit:
Set oSection = Nothing
Set oHeader = Nothing
Set oRng = Nothing
Set oShape = Nothing
Exit Sub
End Sub
-
Thank you so much! It works on any document!