'Word Interop and getting page count

I know in VBA, within a document, I can get page count using ActiveDocument.Range.Information(wdNumberOfPagesInDocument), But I can't find an equivalent of it in VB.Net using Microsoft.Office.Interop.Word.
Is there, perhaps another way I can attain the quantity of pages in a document?

Public Class Window
    'set form level declarations
    Dim appPath As String
    Dim objWordApp As New Word.Application
    Dim objDoc As Word.Document
    Dim errorPosition As String
    Private Sub Window_Load(ByVal sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        objDoc = objWordApp.ActiveDocument
        With objDoc
           pages = .ActiveDocument.Range.Information(wdNumberOfPagesInDocument)
        End With
        objDoc = Nothing
     End Sub
     objWordApp = Nothing
 End Class


Solution 1:[1]

A way is to get last page number:

lastPageNumber = objDoc.Words.Last.Information[Wd.WdInformation.wdActiveEndPageNumber]

Solution 2:[2]

In the Office.Interop.Word Verion 15.0.0

you can try paginate. like this.

objWordApp.Options.Pagination = true;
objWordApp.ActiveDocument.Repagenate();

And Then DocumentFormat.OpenXml Version 2.12.3

using (WordprocessingDocument document = WordprocessingDocument.Open(filePath, false))
{ document.ExtentedFilePropertuesPart.Properties.Pages.Text }

Solution 3:[3]

When you code in VBA, the namespace of the parent application (Word, Excel, etc.) is obvious, so constants such as wdNumberOfPagesInDocument have definitions. With Microsoft.Office.Interop.Word you need to provide the namespace information; for example:

...
With objDoc
    pages = .Range.Information(Word.WdInforma??tion.wdNumberOfPagesInDocument)
End With
....

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2
Solution 3 Squidx3