Solved

Macro to Create Watermark in every section

Posted on 2004-08-31
13
835 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…

813 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