CheckGrammar Method Example

This example begins a spelling and grammar check for all stories in the active document.

ActiveDocument.CheckGrammar

This example begins a spelling and grammar check on section two in MyDocument.doc.

Set Range2 = Documents("MyDocument.doc").Sections(2).Range
Range2.CheckGrammar

This example begins a spelling and grammar check on the selection.

Selection.Range.CheckGrammar

This example displays the result of a grammar check on the selection.

pass = Application.CheckGrammar(String:=Selection.Text)
MsgBox "Selection is grammatically correct: " & pass