Thread: [Solved] Problems with Watermark
View Single Post
 
Old 05-30-2012, 04:24 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your document does indeed have a 'Different first page' layout. Even so, the code I posted should add the watermark to the first page. You can demonstrate it four yourself, by opening your attachment, adding the following code to it (which is just a cut-down version of the code from my previous post), then running the code.
Code:
Sub Test()
Dim Shp As Shape, HdFt As HeaderFooter
With ActiveDocument
  'Add the watermark to each header in the first Section
  With .Sections.First
    For Each HdFt In .Headers
      Set Shp = HdFt.Shapes.AddTextEffect(msoTextEffect1, _
        "FileType", "Arial Narrow", 38, False, False, 0, 0)
      With Shp
        .Name = "PowerPlusWaterMarkObject" & Format(Now, "YYMMDD") & Format(HdFt.Index, "00")
        .TextEffect.NormalizedHeight = False
        .Line.Visible = False
        .Fill.Visible = True
        .Fill.Solid
        .Fill.ForeColor.RGB = RGB(192, 192, 192)
        .Fill.Transparency = 0.5
        .Rotation = 315
        .LockAspectRatio = True
        .Height = InchesToPoints(3.29)
        .Width = InchesToPoints(6.85)
        .WrapFormat.AllowOverlap = True
        .WrapFormat.Side = wdWrapNone
        .Left = InchesToPoints(-0.5)
        .WrapFormat.Type = 3
        .RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
        .RelativeVerticalPosition = wdRelativeVerticalPositionMargin
        .Top = InchesToPoints(3)
      End With
      .Range.FormattedText.ShowAll = False
    Next
  End With
  With .ActiveWindow.View
    .ShowMarkupAreaHighlight = False
    .ShowComments = False
    .ShowRevisionsAndComments = False
  End With
  .FormattingShowClear = True
End With
Set Shp = Nothing
End Sub
The fact you're not getting the expected result suggests your 'NewDoc' might already have a second-page watermark and there is a problem with the reference to either:
• PowerPlusWaterMarkObject325783140; or
• FileType
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote