Share via

Automatic section word count

Anonymous
2015-10-18T11:03:20+00:00

Is there a way to insert a field into a section of a document that shows the number of words in that section?

So far I have only come up with a fairly crude work around by inserting another Word Document into the document instead of using a section (Insert/Object/MS Word...)  and adding the usual word count field within that nested document.

Editing the text is done by double clicking the nested Word file. (Note: the word count field doesn't seem to update by itself, but forcing an update to the field is a lot quicker than carefully highlighting the words you want to count and asking for a word count)

The other disadvantage I have noticed so far with this trick is that the words you put in the nested Word file are left out of any total word count for the main document.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
2015-10-18T23:47:20+00:00

If you run a macro containing the following code, it will insert a statement at the end of the Section in which the selection is located that gives the number of words:

With Selection.Sections(1).Range

    .InsertAfter vbCr & "This Section contains " & .Words.count & " words."

End With

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

Answer accepted by question author

Paul Edstein 82,861 Reputation points Volunteer Moderator
2015-10-18T11:24:14+00:00

No. The only such field that Word has is the NUMWORDS field; and that takes no range-related arguments.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Paul Edstein 82,861 Reputation points Volunteer Moderator
    2017-07-16T22:37:56+00:00

    Perhaps you missed the OP's 'automatic' stipulation and that the word count be inserted into the document. Your approach is not automatic and doesn't insert anything into the document.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2017-07-16T20:58:13+00:00

    If all you want is to find out the word count, you can do that by right-clicking on the section in the navigation pane and then choosing "Select heading and content". Word will then show you the word count of your selection.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2015-10-18T11:36:13+00:00

    No. The only such field that Word has is the NUMWORDS field; and that takes no range-related arguments.

    Thanks Macropod.  I thought that was the case.  I just had to be sure I wasn't missing something really obvious (as I usually do) :)

    Was this answer helpful?

    0 comments No comments