return the number of pages in Microsoft Word

I can get Pages to return the number of pages that a document has like this:


tell application "Pages"
  tell document 1
    count of pages
  end tell
end tell

I can’t see to do the same thing in Word.

I think it has something to do with this command:


(get selection information information type number of pages in document)

But I get an error. Does anybody know how to get Word to return the number of pages in a document?

Like so:


tell application "Microsoft Word"
	
	set rng to text object of active document
	set lastPage to get range information rng information type number of pages in document
	
end tell

This will return the info as text, so you might need to convert it depending on your use case.

That worked. Much thanks.