View Single Post
 
Old 01-10-2014, 03:17 PM
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

Quote:
Originally Posted by jakeic View Post
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.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote