el_pablo
04-06-2011, 07:41 AM
Hello there,
I have a problem here. My document don't seem to change the page starting number when I set a value in it.
I can see the number style change, but not the starting number. When I verify the startingPage property with the watchlist is stays with a value of 0. Is there something wrong with my code?
Here is my code
Sub setDocVar(addendaNumber As String, startPage As Long)
With ActiveDocument
.variables("numeroAnnexe").Value = UCase(addendaNumber)
End With
With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).PageNumbers
.StartingNumber = startPage
.NumberStyle = wdPageNumberStyleArabic
.IncludeChapterNumber = False
.RestartNumberingAtSection = False
End With
ActiveDocument.Fields.Update
End Sub
I have a problem here. My document don't seem to change the page starting number when I set a value in it.
I can see the number style change, but not the starting number. When I verify the startingPage property with the watchlist is stays with a value of 0. Is there something wrong with my code?
Here is my code
Sub setDocVar(addendaNumber As String, startPage As Long)
With ActiveDocument
.variables("numeroAnnexe").Value = UCase(addendaNumber)
End With
With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).PageNumbers
.StartingNumber = startPage
.NumberStyle = wdPageNumberStyleArabic
.IncludeChapterNumber = False
.RestartNumberingAtSection = False
End With
ActiveDocument.Fields.Update
End Sub