How get page numbers???

C

condestable

Hi!!!!!

I need count numbers of pages of a document.

How I get this number en VBA or VB.NET?

Thanks in advance?
 
G

Greg

Hi,

Something like:

Sub PageCount()

NumPages = ActiveDocument.BuiltInDocumentProperties
(wdPropertyPages)
If NumPages > 1 Then
MsgBox "This document contains " & NumPages & " pages."
Else
MsgBox "This document contains " & NumPages & " page."
End If
End Sub
 
Top