Quote:
Originally Posted by jakeic
I amended it a little bit to fit my purpose better, I added a userform to obtain the reference information from the user.
then store the starting reference numerical number in variable: Myref
say the user input 100
myref = 100
and i would like to reference the first page as 100, the next one is 101... etc
|
There are at least three ways of handling this:
1. set the page StartingNumber to whatever you want. For example, use:
Code:
.Sections(1).Headers(wdHeaderFooterPrimary).PageNumbers.StartingNumber = myref
2. hard-code the page #s instead of using a field. For example, use:
Code:
.Text = "Ref. No.: " & StrPre & (i + myref - 1) & vbCr & "Signature " & Format(Now, "DDDD, D MMM YYYY")
and replace:
Code:
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
with:
Code:
.Paragraphs.First.Range.Font.ColorIndex = wdRed
3. add a calculation to the page# field code. Either of the above two should meets your needs, though.