Bookmark.GetSpellingSuggestions Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a SpellingSuggestions collection that represents the words suggested as spelling replacements for the first word in the Bookmark control.
public Microsoft.Office.Interop.Word.SpellingSuggestions GetSpellingSuggestions (ref object CustomDictionary, ref object IgnoreUppercase, ref object MainDictionary, ref object SuggestionMode, ref object CustomDictionary2, ref object CustomDictionary3, ref object CustomDictionary4, ref object CustomDictionary5, ref object CustomDictionary6, ref object CustomDictionary7, ref object CustomDictionary8, ref object CustomDictionary9, ref object CustomDictionary10);
abstract member GetSpellingSuggestions : obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj -> Microsoft.Office.Interop.Word.SpellingSuggestions
Public Function GetSpellingSuggestions (Optional ByRef CustomDictionary As Object, Optional ByRef IgnoreUppercase As Object, Optional ByRef MainDictionary As Object, Optional ByRef SuggestionMode As Object, Optional ByRef CustomDictionary2 As Object, Optional ByRef CustomDictionary3 As Object, Optional ByRef CustomDictionary4 As Object, Optional ByRef CustomDictionary5 As Object, Optional ByRef CustomDictionary6 As Object, Optional ByRef CustomDictionary7 As Object, Optional ByRef CustomDictionary8 As Object, Optional ByRef CustomDictionary9 As Object, Optional ByRef CustomDictionary10 As Object) As SpellingSuggestions
Parameters
- CustomDictionary
- Object
Either an expression that returns a Dictionary or the file name of the custom dictionary.
- IgnoreUppercase
- Object
true
to ignore words in all uppercase letters. If this argument is omitted, the current value of the IgnoreUppercase property is used.
- MainDictionary
- Object
Either an expression that returns a Dictionary or the file name of the main dictionary. If you do not specify a main dictionary, Microsoft Office Word uses the main dictionary that corresponds to the language formatting of the first word in the Bookmark control.
- SuggestionMode
- Object
Specifies the way Word makes spelling suggestions. Can be one of the following WdSpellingWordType constants: wdAnagram, wdSpellword, or wdWildcard. The default value is wdSpellword.
- CustomDictionary2
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary3
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary4
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary5
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary6
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary7
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary8
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary9
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
- CustomDictionary10
- Object
Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
Returns
A SpellingSuggestions collection.
Examples
The following code example adds a Bookmark control with misspelled text to the first paragraph and then displays the first spelling suggestion in a message box.
This example is for a document-level customization.
private void BookmarkGetSpellingSuggestions()
{
this.Paragraphs[1].Range.InsertParagraphBefore();
Microsoft.Office.Tools.Word.Bookmark bookmark1 =
this.Controls.AddBookmark(this.Paragraphs[1].Range,
"bookmark1");
bookmark1.Text = "missspeling.";
object IgnoreUppercase = true;
object SuggestionMode = Word.WdSpellingWordType.wdSpellword;
Word.SpellingSuggestions suggestions =
bookmark1.GetSpellingSuggestions(ref missing, ref IgnoreUppercase,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing);
MessageBox.Show("The first suggestion is: " +
suggestions[1].Name);
}
Private Sub BookmarkGetSpellingSuggestions()
Me.Paragraphs(1).Range.InsertParagraphBefore()
Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
Bookmark1.Text = "missspeling."
Dim suggestions As Word.SpellingSuggestions = _
Bookmark1.GetSpellingSuggestions(IgnoreUppercase:=True, _
SuggestionMode:=Word.WdSpellingWordType.wdSpellword)
MessageBox.Show("The first suggestion is: " & suggestions(1).Name)
End Sub
Remarks
Optional Parameters
For information on optional parameters, see Optional Parameters in Office Solutions.