![]() |
|
#8
|
||||
|
||||
|
I can't see why that would occur. the following works for me:
Code:
Sub Demo()
Dim i As Long, Rng As Range, Shp As Shape
Dim iStart As Long, StrPfx As String, StrSig As String
With ActiveDocument
StrPfx = InputBox("What is the Ref Prefix?")
StrSig = InputBox("Who's Signature?")
iStart = CLng(InputBox("What is the Starting #?"))
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:=100, Height:=40, Anchor:=Rng)
With Shp
.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
.Left = wdShapeRight
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Top = wdShapeTop
.Fill.Visible = False
With .TextFrame.TextRange
.ParagraphFormat.SpaceAfter = 0
.ParagraphFormat.SpaceBefore = 0
.Font.Bold = True
.Font.Size = 8
.Font.ColorIndex = wdBlue
.Text = "Ref. No.: " & StrPfx & (i + iStart - 1) & vbCr & StrSig & " " & Format(Now, "D MMM YYYY")
.Paragraphs.First.Range.Font.ColorIndex = wdRed
End With
End With
Next
End With
End Sub
PS: Please don't quote entire posts in your reply - only quote what's actually necessary.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| pages, referencing, text box |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Text disappears (but headings and text boxes ok) when printing 1 page of a document | msfordummies | Word | 1 | 02-21-2013 10:28 PM |
Macro to Add Text and Page Number to Top of Each Page Within Text
|
eslight | Word VBA | 10 | 12-07-2012 08:18 PM |
Selection of all Text for a specific page in word is spanning selection across pages
|
ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |
| 2 page document printing problem, text from page 1 in layout of page 2 when printed | laurawether45 | Word | 1 | 08-02-2012 07:03 AM |
MS Word, page goes to next page when entering data on previous page
|
munna94 | Word | 2 | 12-30-2010 08:12 AM |