共用方式為


Word) (Document.GrammarChecked 屬性

True 是表示 如果已經執行文法檢查在指定的範圍或文件。 可讀寫的 Boolean

語法

expressionGrammarChecked

表達 代表 Document 物件的變數。

註解

會傳回 False 表示所有或部分指定的文件有不被檢查文法。 若要重新檢查文件中的文法,設定 GrammarChecked 屬性設 為 False

範例

此範例會判斷是否已在使用中檔中檢查文法。 如果有,則會顯示字數計數。 如果尚未檢查文法,則會啟動拼字和文法檢查。

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

本範例會將使用中文件的 GrammarChecked 屬性設定為 False,然後再次執行文法檢查。

ActiveDocument.GrammarChecked
= False
ActiveDocument.CheckGrammar

另請參閱

Document 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應