View Single Post
 
Old 07-18-2020, 10:06 AM
gmaxey gmaxey is online now Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

I don't see anything wrong. When I tested with three pages, it worked fine. However, with five pages, sometimes first two pages were rotated and sometimes only pages after the first two were rotated.



Why don't you put the watermarks in the header:

Code:
Sub CustomWatermark()
Dim oDoc As Document
Dim oRng As Range
Dim oShp As Shape
Dim i As Long
Dim strWatermark As String

    Set oDoc = ActiveDocument
    strWatermark = InputBox("Enter Watermark")
    For i = 1 To 3
      Set oRng = oDoct.Sections(1).Headers(i).Range
      oRng.Collapse wdCollapseStart
      Set oShp = oDoc.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
                                            Left:=InchesToPoints(1), _
                                            Top:=InchesToPoints(4), _
                                            Width:=InchesToPoints(6), _
                                            Height:=InchesToPoints(2), _
                                            Anchor:=oRng)
      With oShp
        .Line.Visible = msoFalse
        .Rotation = -45
        .WrapFormat.Type = wdWrapBehind
        .TextFrame.HorizontalAnchor = msoAnchorCenter
        .TextFrame.VerticalAnchor = msoAnchorMiddle
        With .TextFrame.TextRange
          .Font.AllCaps = True
          .Font.Size = "60"
          .Font.ColorIndex = wdGray25
          .ParagraphFormat.Alignment = wdAlignParagraphCenter
          .Text = strWatermark
        End With
     End With
   Next
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote