Public Sub test()
Dim NbPages As Integer
ActiveDocument.Bookmarks("\endofdoc").Select
NbPages = Selection.Information(wdActiveEndPageNumber)
End Sub