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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top