Solved

Macro to Create Watermark in every section

Posted on 2004-08-31
13
832 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

919 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now