Word) (Range.GetSpellingSuggestions 方法

會傳回代表字的 SpellingSuggestions 集合的建議取代指定範圍中第一個單字的拼字。

語法

運算式GetSpellingSuggestions (CustomDictionaryIgnoreUppercaseMainDictionarySuggestionModeCustomDictionary2CustomDictionary3CustomDictionary4CustomDictionary5、CustomDictionary6CustomDictionary7CustomDictionary8CustomDictionary9CustomDictionary10)

需要 expression。 代表 Range 物件的變數。

參數

名稱 必要/選用 資料類型 描述
CustomDictionary 選用 Variant 可以是運算式會傳回 Dictionary 物件或是自訂字典的檔名。
IgnoreUppercase 選用 Variant True 為忽略全部大寫字母。 如果省略此引數,則會使用 IgnoreUppercase 屬性的目前值。
MainDictionary 選用 Variant 可以是運算式會傳回 Dictionary 物件或是主字典的檔名。 如果您沒有指定主字典,Microsoft Word 會使用主字典對應至該範圍的第一個字的語言格式設定。
SuggestionMode 選用 Variant 會指定 Word 進行拼字建議的方式。 可以是下列其中一個 WdSpellingWordType 常數。 預設值為 wdSpellword
CustomDictionary2CustomDictionary10 選用 Variant 可以是運算式會傳回 Dictionary 物件或其他自訂字典的檔案名稱。 您可以指定多達九個額外的字典。

傳回值

SpellingSuggestions

註解

如果此單字拼字正確, SpellingSuggestions 物件的 Count 屬性會傳回 0 (零)。

範例

這個範例會為選取範圍內的第一個單字尋找替代的拼字建議。 如果找到拼字建議,這個範例就會對選取範圍執行拼字檢查。

If Selection.Range.GetSpellingSuggestions.Count = 0 Then 
 Msgbox "No suggestions." 
Else 
 Selection.Range.CheckSpelling 
End If

另請參閱

Range 物件

支援和意見反應

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