Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Nov 2005
    Location
    Monkton, Maryland, USA
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro for Watermark (2003)

    I work in a law office and they prefer to have a "DRAFT" watermark on all documents until finalized. Is there a way to make a macro to insert one and another macro to get rid of it? I have tried to do this without success. Our Letterhead information is stored in the header. Any help would be appreciated. Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Watermark (2003)

    The following macro will toggle all shapes in the header (in all sections) on/off. If you put a DRAFT watermark in the document, and if the watermark is the only shape in the header, it should do what you want:

    Sub ToggleEm()
    Dim shp As Shape
    For Each shp In ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Shapes
    shp.Visible = Not shp.Visible
    Next shp
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Nov 2005
    Location
    Monkton, Maryland, USA
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro for Watermark (2003)

    Hi Hans,

    Thanks for your quick reply. I tried the macro and it not only deleted my Draft watermark, it also deleted the letterhead information in the header! It just seems to me that there should be an easy macro to insert a watermark and one to delete it as well and still leave my letterhead intact. What am I doing wrong?

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Macro for Watermark (2003)

    I don't think it's deleted, just hidden. (Added: Run the macro again to show all shapes again.)

    To be more selective about the shapes in the header might require that your watermark be identified with a particular tag or other identifer. Perhaps you could modify the macro to first check whether the shape is of the relevant type (word art??) before hiding it.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Watermark (2003)

    Jefferson already pointed out that the letterhead hasn't been deleted but hidden, and that running the macro a second time should make it visible again.

    Try this version:

    Sub ToggleEm()
    Dim shp As Shape
    For Each shp In ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Shapes
    If shp.Type = msoTextEffect Then
    shp.Visible = Not shp.Visible
    End If
    Next shp
    End Sub

  6. #6
    2 Star Lounger
    Join Date
    Nov 2005
    Location
    Monkton, Maryland, USA
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro for Watermark (2003)

    I ran the macro twice and my header was gone. Any other suggestions?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Watermark (2003)

    I can't explain that. The macro doesn't delete anything, it only toggles the visibility of shapes.

    Note: to make the letterhead visible again, you should run the original macro! The new one only looks at WordArt objects. To make sure, use this version:

    Sub MakeVisible()
    Dim shp As Shape
    For Each shp In ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Shapes
    shp.Visible = True
    Next shp
    End Sub

  8. #8
    2 Star Lounger
    Join Date
    Nov 2005
    Location
    Monkton, Maryland, USA
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro for Watermark (2003)

    By "original macro" do you mean for the letterhead? I have my letterhead set up as a template; there is no macro involved. I apologize if I am being dense here!

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Watermark (2003)

    If you still have the problem that something has disappeared from the page header, run the macro from my previous reply in this thread (<post:=547,721>post 547,721</post:>).

  10. #10
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Macro for Watermark (2003)

    If the logo is still hidden from Hans macro then you will need to run it again to reveal it once more. Once that is done you might have luck with the macro in <post:=157,050>post 157,050</post:> which was written well before the Word 2003 made watermarking easier. That macro toggles the appearance and disappearance of the watermark.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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