Applescript to get MS Word current word count

applescriptautomationms officeword-processor

Is there an AppleScript command which will grab the word count of the currently open Microsoft Word® document?

Best Answer

Yes. You could use this:

tell application "Microsoft Word"
    set theDoc to document 1
    return document property "Number of words" of theDoc
end tell

Since you asked for the word count of "the currently open Microsoft Word® document" this does it. This script works ONLY in the case where you have a single Word document open.

It works for Word 2011 and for Word 16.25 (from Office 365).