Skip to content

Instantly share code, notes, and snippets.

@omarjimz
Created July 7, 2015 03:24
Show Gist options
  • Save omarjimz/a427bd55e982155c0b12 to your computer and use it in GitHub Desktop.
Save omarjimz/a427bd55e982155c0b12 to your computer and use it in GitHub Desktop.
Private Sub PagingButton_Click()
Selection.Sections(1).Headers(1).PageNumbers.NumberStyle = wdPageNumberStyleArabic
Selection.Sections(1).Headers(1).PageNumbers.HeadingLevelForChapter = 0
Selection.Sections(1).Headers(1).PageNumbers.IncludeChapterNumber = False
Selection.Sections(1).Headers(1).PageNumbers.ChapterPageSeparator = wdSeparatorHyphen
Selection.Sections(1).Headers(1).PageNumbers.RestartNumberingAtSection = True
Selection.Sections(1).Headers(1).PageNumbers.StartingNumber = LastPageTextBox.Text + 1
LastPageRead = LastPageTextBox.Text + _
ActiveDocument.Content.Information(wdNumberOfPagesInDocument)
Selection.Sections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _
wdAlignPageNumberRight, FirstPage:=True
LastPageTextBox.Text = LastPageTextBox.Text + _
ActiveDocument.Content.Information(wdNumberOfPagesInDocument)
Unload PaginarGUI
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment