Flagging Sentences Starting with Undesirable Words

Written by Allen Wyatt (last updated April 11, 2026)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365


Jasmin needs a way to somehow flag sentences that begin with a set of undesirable words, such as conjunctions.

The easiest way to accomplish this task is to use a macro. Conceptually, the macro needs to step through each sentence in a document, look at the first word in the sentence, and flag the word if it is undesired. The following macro will do just that:

Sub HighlightBadFirstWords()
    Const BadWordList = " And Or But Hopefully "
    Dim s As Range

    For Each s In ActiveDocument.Content.Sentences
        If InStr(1, BadWordList, " " & _
          Trim(s.Words.First.Text & " "), vbTextCompare) Then
            s.Words.First.HighlightColorIndex = wdYellow
        End If
    Next s
End Sub

The key to this macro is putting together the undesirable words in the BadWordList constant. Notice that each word is separated by a space and there is a space at the beginning and end of the words. This spacing is important. It is also important to make sure that none of the words includes any punctuation marks.

The reason for this is rather simple. The macro uses the Words collection for each sentence in the document. This collection treats punctuation as a word. Thus, if a sentence began with "But," (with the comma), then that is two words—"But" and ",".

You should also understand that the macro is case insensitive. So, if a sentence begins with "AND," that will be marked, even though the BadWordList constant contains "And". If you want to make the macro pay attention to case, then change vbTextCompare to vbBinaryCompare.

All of that said, Jasmin may want to remember that there is no grammatical rule that indicates it is improper for a sentence to start with a conjunction. Check your favorite style guide, and you will find that this is the case. (Mine tends to be the Chicago Manual of Style. In the 17th edition, see 5.203; in the 18th edition see 5.209.) Even with no disallowing rule in place, however, you may find it helpful to mark such words to make sure that their sentence-beginning use is warranted.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13973) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

AutoText Entries Don't Stick

AutoText can be a great tool, but it is of little worth if you can't get Word to remember the AutoText entries you ...

Discover More

References to Hyperlinks aren't Hyperlinks

Make a reference to a hyperlink in a formula, and you may be surprised that the reference doesn't return an active ...

Discover More

Formatted Dates Appear Differently on Different Systems

When you format a date in a specific manner, you may be surprised to see that the format changes when you open the ...

Discover More

Do More in Less Time! An easy-to-understand guide to the more advanced features available in the Microsoft 365 version of Word. Enhance the quality of your documents and boost productivity in any field with this in-depth resource. Complete your Word-related tasks more efficiently as you unlock lesser-known tools and learn to quickly access the features you need. Check out Microsoft 365 Word For Professionals For Dummies today!

More WordTips (ribbon)

Unknown Non-Printing Characters

When you paste information into Word from the internet, you may get more than just the plain text you hoped for. This tip ...

Discover More

Creating Special, Compound Characters

If you have a need for special characters (particularly in technical documents), Word provides a couple of ways you can ...

Discover More

Using Extend Mode

One of the most overlooked shortcut keys in Word has to be the extend key. Yet, learning how to use this simple key can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 9 - 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.