Word.Tips.Net WordTips (Menu Interface)

Finding Long Sentences

Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Finding Long Sentences.

Bruce is looking for some way to have Word automatically mark long sentences in a document. For instance, he may want to have those sentences with more than 20 words marked in some color so that they are easily located.

Fortunately, Word maintains a Sentences collection, accessible through VBA, that consists of each sentence in a document. You can examine each item in this collection (each individual sentence) to determine if it is longer than your desired length. The following macro provides an example of how this is done.

Sub Mark_Long()
    Dim iMyCount As Integer
    Dim iWords As Integer

    If Not ActiveDocument.Saved Then
    End If

    'Reset counter
    iMyCount = 0 

    'Set number of words
    iWords = 20

    For Each MySent In ActiveDocument.Sentences
        If MySent.Words.Count > iWords Then 
            MySent.Font.Color = wdColorRed
            iMyCount = iMyCount + 1
        End If
    MsgBox iMyCount & " sentences longer than " & _
      iWords & " words."
End Sub

Notice that each sentence is examined, and if it is longer than the desired length (defined by the variable iWords) then the sentence is changed to a red font color. This makes it easy to examine the document and discover which sentences exceed the length you specified.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (3381) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Finding Long Sentences.

Related Tips:

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 5+3 (To prevent automated submissions and spam.)
           Commenting Terms

Comments for this tip:

Peter Thomas    16 May 2016, 19:31
This may be useful. I have had trouble over the last couple of years getting documents to preview in Windows explorer. Searching on the Internet leads me to believe I'm one of many. Today I solved my problem and it may be useful to others: - This is for Word 2016

1. Open Windows Explorer.
2. Click to the View tab.
3. Click on Preview Pane.
4. Go to the right hand side and click Options.
5. Click on the selection that drops down.
6. In the Folder Options dialogue box click on View
7. Scroll down and click the check-box for "Show preview handlers in preview pane".
8. Click Apply and OK. The preview for will now show in the Preview Pane of Windows Explorer.

I hope this can be of value to you and your readers.


Peter Thomas
Doug P    22 Apr 2015, 08:13
Just wanted to say thanks - this is great.

I'm an academic with a bad habit of writing long sentences and love the simplicity & flexibility of this.

Thanks for making and sharing this, you've made something that is useful. I hope you derive some satisfaction from knowing that!

Wende    13 Nov 2013, 04:16

I am experiencing the same problem as beyondnerd. Is there a way to exclude puctuation marks from the sentence?

Please please help!
beyondnerd    24 Apr 2013, 16:47
I just noticed a problem. The value of MySent.Words.Count seems to include the number of words plus the number of punctuation marks (commas, quotation marks etc.).Consequently the following 19 word sentence (for example) is marked as having over 20 words.

After the yellow sun goes down, beyond the horizon, the quick brown fox jumps over the fat lazy dogs.

Is there a way to get the actual word (not including punctuation count)for each sentence? The word count function on the review tab gets the correct count.
beyondnerd    15 Apr 2013, 01:49
Very helpful, thank you
José de la Riva    03 Mar 2013, 10:38
Hi, Allen. I´m having problems with this macro, because my Word 2007 doesn´t understand "'Set number of words". In Visual Basic, it´s highlighted in red, as other commands I´ve found in Jack Lyon´s Macro Cookbook. Is it due to my version of MS Word? Will it work in more recent versions of the program, like Word 2010? Thank you!
Sam Hale    23 Nov 2012, 05:58
Really useful, thanks!

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.