Solved

Macro to Create Watermark in every section

Posted on 2004-08-31
13
845 Views
Last Modified: 2012-08-14
I have a user that uses a watermark called "Specimen" on a multitude of documents but it tired of having to constantly type this in as it is not a normal watermark.  I've created a basic macro for her to use, but any time she has the different first page option checked the macro doesn't work.  The language is below.  Any help would be greatly appreciated.

Angela Gallo
Desktop Services Manager
McNair Law Firm, PA
Columbia, SC

Sub Specimen()
'
' Specimen Macro
' Macro recorded 8/24/2004 by Angela C Gallo
'
    ActiveDocument.Sections(1).Range.Select
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.HeaderFooter.Shapes.AddTextEffect(PowerPlusWaterMarkObject1, _
        "SPECIMEN", "Times New Roman", 1, False, False, 0, 0).Select
    Selection.ShapeRange.Name = "PowerPlusWaterMarkObject1"
    Selection.ShapeRange.TextEffect.NormalizedHeight = False
    Selection.ShapeRange.Line.Visible = False
    Selection.ShapeRange.Fill.Visible = True
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
'   Selection.ShapeRange.Fill.Transparency = 0
    Selection.ShapeRange.Rotation = 315
    Selection.ShapeRange.LockAspectRatio = True
    Selection.ShapeRange.Height = InchesToPoints(1.67)
    Selection.ShapeRange.Width = InchesToPoints(7.5)
    Selection.ShapeRange.WrapFormat.AllowOverlap = False
    Selection.ShapeRange.WrapFormat.Side = wdWrapNone
    Selection.ShapeRange.WrapFormat.Type = 3
    Selection.ShapeRange.RelativeHorizontalPosition = _
        wdRelativeVerticalPositionMargin
    Selection.ShapeRange.RelativeVerticalPosition = _
        wdRelativeVerticalPositionMargin
    Selection.ShapeRange.Left = wdShapeCenter
    Selection.ShapeRange.Top = wdShapeCenter
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    ActiveWindow.ActivePane.SmallScroll Down:=9
End Sub
0
Comment
Question by:Bonilas
  • 7
  • 5
13 Comments
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 11947222
I'm sure I could help you but I what is PowerPlusWaterMarkObject1?

I get an error message.  What is it?  Just a watermark?
0
 

Author Comment

by:Bonilas
ID: 11947293
Yes, it's just a watermark.  When I created the macro originally, I created using the record feature and when I went into the Format | Background | Printed Watermark section and typed Specimen in, that's the object tytle it created.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 11947313
Maybe you can work with this macro and replace what I put in for your proper watermark:

Sub Specimen()
    Selection.HomeKey
    If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
        ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
        ActivePane.View.Type = wdOutlineView Then
        ActiveWindow.ActivePane.View.Type = wdPrintView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.HeaderFooter.Shapes.AddTextEffect(msoTextEffect2, "SPECIMEN", _
        "Arial Black", 60#, msoFalse, msoFalse, 130.5, 108.25).Select
    If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
        ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
        ActivePane.View.Type = wdOutlineView Then
        ActiveWindow.ActivePane.View.Type = wdPrintView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.WholeStory
    Selection.Copy
    ActiveWindow.ActivePane.View.NextHeaderFooter
    Selection.Paste
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub

It works for me!
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Bonilas
ID: 11947490
My Help Desk person is estatic, it works wonderfully.  Thank you so much.

Angela Gallo
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 11947537
Well - I am SOOOOOOOOOOO pleased!  
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 11947863
Bonilas - if my answer provided the correct solution, then you need to close the question by clicking on the accept button next to the proper answer.  Thanks.

Joanne

P.S. - I've worked for lawyers since June 71! (see profile)  I feel your pain :)
0
 

Author Comment

by:Bonilas
ID: 11947942
Wow! I'll bet you do know. Thanks again for the help and so quickly too.  I look forward to talking with you in the future.

Angela
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 11947967
Glad to help Angela! Thanks for the points and grade.   Look forward to your next visit here :)
0
 

Author Comment

by:Bonilas
ID: 11952576
Joanne, one more question.   How can I lighten the shade or change the color?
0
 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 250 total points
ID: 11953090
Try this:

Sub Specimen()
    Selection.HomeKey Unit:=wdStory
    If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
        ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
        ActivePane.View.Type = wdOutlineView Then
        ActiveWindow.ActivePane.View.Type = wdPrintView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.HeaderFooter.Shapes.AddTextEffect(msoTextEffect2, "SPECIMEN", _
        "Arial Black", 60#, msoFalse, msoFalse, 166.5, 150.75).Select
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
    Selection.ShapeRange.Fill.Transparency = 0#
    Selection.ShapeRange.Line.Weight = 0.75
    Selection.ShapeRange.Line.DashStyle = msoLineSolid
    Selection.ShapeRange.Line.Style = msoLineSingle
    Selection.ShapeRange.Line.Transparency = 0#
    Selection.ShapeRange.Line.Visible = msoFalse
    Selection.ShapeRange.LockAspectRatio = msoFalse
    Selection.ShapeRange.Height = 151.9
    Selection.ShapeRange.Width = 279.35
    Selection.ShapeRange.Rotation = 0#
    Selection.ShapeRange.RelativeHorizontalPosition = _
        wdRelativeHorizontalPositionColumn
    Selection.ShapeRange.RelativeVerticalPosition = _
        wdRelativeVerticalPositionParagraph
    Selection.ShapeRange.Left = wdShapeCenter
    Selection.ShapeRange.Top = InchesToPoints(1.59)
    Selection.ShapeRange.LockAnchor = False
    Selection.ShapeRange.WrapFormat.AllowOverlap = True
    Selection.ShapeRange.WrapFormat.Side = wdWrapLargest
    Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
    Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
    Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
    Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
    Selection.ShapeRange.WrapFormat.Type = 3
    Selection.ShapeRange.ZOrder 4
    Selection.WholeStory
    Selection.WholeStory
    Selection.Copy
    ActiveWindow.ActivePane.View.NextHeaderFooter
    Selection.Paste
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
0
 

Author Comment

by:Bonilas
ID: 11954804
Perfect.  Thanks again.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 11955575
:)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question