Solved

Macro to Create Watermark in every section

Posted on 2004-08-31
13
829 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.

707 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

13 Experts available now in Live!

Get 1:1 Help Now