View Single Post
 
Old 01-10-2014, 04:16 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
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

You can indeed format the page #s with a prefix - and to start at a # other than 1 - but since it appears you need a macro, here's some code to get you started:
Code:
Sub Demo()
Dim i As Long, Rng As Range, Shp As Shape
With ActiveDocument
  For i = 1 To .ComputeStatistics(wdStatisticPages)
    Set Rng = .GoTo(What:=wdGoToPage, Name:=i)
    Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")
    Rng.Collapse wdCollapseStart
    Set Shp = .Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
      Left:=0, Top:=0, Width:=180, Height:=60, Anchor:=Rng)
    With Shp
      .RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
      .Left = wdShapeLeft
      .RelativeVerticalPosition = wdRelativeVerticalPositionMargin
      .Top = wdShapeTop
      .Fill.Visible = False
      With .TextFrame.TextRange
        .Font.Bold = True
        .Font.ColorIndex = wdBlue
        .Text = "Ref. No.: T" & vbCr & "Signature " & Format(Now, "DDDD, D MMM YYYY")
        Set Rng = .Paragraphs.First.Range
        With Rng
          .Font.ColorIndex = wdRed
          .End = .End - 1
          .Collapse wdCollapseEnd
        End With
        .Fields.Add Range:=Rng, Type:=wdFieldEmpty, Text:="PAGE \# 000", PreserveFormatting:=False
      End With
    End With
  Next
End With
End Sub
As coded, the macro makes the textboxes transparent. If you don't want that, delete '.Fill.Visible = False'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote