Document.GrammarChecked property (Word)

True if a grammar check has been run on the specified range or document. Read/write Boolean.

Syntax

expression. GrammarChecked

expression A variable that represents a Document object.

Remarks

Returns False if all or some of the specified document has not been checked for grammar. To recheck the grammar in a document, set the GrammarChecked property to False.

Example

This example determines whether grammar has been checked in the active document. If it has, the word count is displayed. If grammar has not been checked, a spelling and grammar check is started.

Set myStat = ActiveDocument.ReadabilityStatistics 
passGram = ActiveDocument.GrammarChecked 
If passGram = True Then 
 Msgbox myStat(1).Name & " - " & myStat(1).Value 
Else 
 ActiveDocument.CheckGrammar 
End If

This example sets the GrammarChecked property to False for the active document, and then it runs a grammar check again.

ActiveDocument.GrammarChecked
= False
ActiveDocument.CheckGrammar

See also

Document Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.