by Allen Wyatt
(last updated April 18, 2015)
Sarma frequently checks grammar (and readability) of only a portion of the document, and he uses a macro to do it. It would be helpful to have the macro to bypass the "do you want to check the remainder" dialog box that spellchecker always displays, but Sarma doesn't know how to do this.
There are two distinct things being referenced by Sarma: the spellchecker and the grammar checker. Sarma wants to use the grammar checker, but it is apparently the spellchecker that is displaying the dialog box that he wants to avoid.
There are two types of dialog boxes that you can access through macros when it comes to spellchecking and grammar checking. One is a combined dialog box (which handles spelling and grammar together) and the other is a "separated" dialog box that deals with either grammar checking or spellchecking, independently. The dialog boxes appear nearly identical but they operate differently. To make matters more confusing the dialog box title is "Spelling & Grammar" even for the single-action versions.
If you click the Spelling & Grammar tool on the Review tab of the ribbon, Word opens the combined dialog box. This dialog box can also be opened with the following macro command:
This dialog box will check both spelling and grammar. When the end of the selected text has been reached then the message appears "Word has finished checking the selection. Do you want to continue checking the remainder of the document?"
To display the single-purpose dialog box to check grammar, you can use this command, instead:
The dialog box appears very similar to the combined-purpose dialog box, but it is subtly different in usage. Since no spellchecking is being done, no "check remainder" dialog box will be displayed when the grammar checking is complete.
As an example of how to effectively check just the grammar of a selection, consider the following macro:
Sub CheckGrammarInSelection() Dim aRange As Range Set aRange = Selection.Range aRange.GrammarChecked = False ActiveDocument.ShowGrammaticalErrors = True If Selection.Range.Characters.Count > 0 Then Options.CheckGrammarWithSpelling = True Selection.Range.CheckGrammar End If aRange.Select aRange.GrammarChecked = False End Sub
The macro starts by making sure that any "already checked" flags for the selection are cleared (through the GrammarChecked property) and then checks the selection.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9950) applies to Microsoft Word 2007, 2010, and 2013.
Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!
As you type your document, Word flags words and phrases it thinks may be incorrect. The source of these various flaggings ...Discover More
Word's grammar checker dutifully tries to mark all the questionable grammar in your sentences. If you are tired of a ...Discover More
In my English classes in junior high, I would get marked down if I started sentences with a conjunction. ("There's a ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.