Results 1 to 3 of 3

Thread: Remove any Watermark

  1. #1
    VBAX Newbie
    May 2018

    Remove any Watermark


    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

  2. #2
    The following should do that (for text watermarks like those mentioned).

    Sub RemoveWaterMarks()
    'Graham Mayor - - 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
        Set oSection = Nothing
        Set oHeader = Nothing
        Set oRng = Nothing
        Set oShape = Nothing
        Exit Sub
    End Sub
    Graham Mayor - MS MVP (Word)
    Visit my web site for more programming tips and ready made processes

  3. #3
    VBAX Newbie
    May 2018
    Thank you so much! It works on any document!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts