Find.HitHighlight Method
Highlights all found matches and returns a Boolean that represents whether matches were found.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)
Syntax
'Declaration
Function HitHighlight ( _
ByRef FindText As Object, _
ByRef HighlightColor As Object, _
ByRef TextColor As Object, _
ByRef MatchCase As Object, _
ByRef MatchWholeWord As Object, _
ByRef MatchPrefix As Object, _
ByRef MatchSuffix As Object, _
ByRef MatchPhrase As Object, _
ByRef MatchWildcards As Object, _
ByRef MatchSoundsLike As Object, _
ByRef MatchAllWordForms As Object, _
ByRef MatchByte As Object, _
ByRef MatchFuzzy As Object, _
ByRef MatchKashida As Object, _
ByRef MatchDiacritics As Object, _
ByRef MatchAlefHamza As Object, _
ByRef MatchControl As Object, _
ByRef IgnoreSpace As Object, _
ByRef IgnorePunct As Object, _
ByRef HanjaPhoneticHangul As Object _
) As Boolean
'Usage
Dim instance As Find
Dim FindText As Object
Dim HighlightColor As Object
Dim TextColor As Object
Dim MatchCase As Object
Dim MatchWholeWord As Object
Dim MatchPrefix As Object
Dim MatchSuffix As Object
Dim MatchPhrase As Object
Dim MatchWildcards As Object
Dim MatchSoundsLike As Object
Dim MatchAllWordForms As Object
Dim MatchByte As Object
Dim MatchFuzzy As Object
Dim MatchKashida As Object
Dim MatchDiacritics As Object
Dim MatchAlefHamza As Object
Dim MatchControl As Object
Dim IgnoreSpace As Object
Dim IgnorePunct As Object
Dim HanjaPhoneticHangul As Object
Dim returnValue As Boolean
returnValue = instance.HitHighlight(FindText, _
HighlightColor, TextColor, MatchCase, _
MatchWholeWord, MatchPrefix, MatchSuffix, _
MatchPhrase, MatchWildcards, MatchSoundsLike, _
MatchAllWordForms, MatchByte, MatchFuzzy, _
MatchKashida, MatchDiacritics, MatchAlefHamza, _
MatchControl, IgnoreSpace, IgnorePunct, _
HanjaPhoneticHangul)
bool HitHighlight(
ref Object FindText,
ref Object HighlightColor,
ref Object TextColor,
ref Object MatchCase,
ref Object MatchWholeWord,
ref Object MatchPrefix,
ref Object MatchSuffix,
ref Object MatchPhrase,
ref Object MatchWildcards,
ref Object MatchSoundsLike,
ref Object MatchAllWordForms,
ref Object MatchByte,
ref Object MatchFuzzy,
ref Object MatchKashida,
ref Object MatchDiacritics,
ref Object MatchAlefHamza,
ref Object MatchControl,
ref Object IgnoreSpace,
ref Object IgnorePunct,
ref Object HanjaPhoneticHangul
)
Parameters
- FindText
Type: System.Object%
Specifies the text to find. Use an empty string ("") to search for formatting only. You can search for special characters by specifying appropriate character codes. For example, "^p" corresponds to a paragraph mark and "^t" corresponds to a tab character.
- HighlightColor
Type: System.Object%
Specifies the highlight color for the text. Can be any RGB color or one of the WdColor enumeration values.
- TextColor
Type: System.Object%
Specifies the color of the text. Can be any RGB color or one of the WdColor enumeration values.
- MatchCase
Type: System.Object%
True to specify that the find text be case-sensitive. Corresponds to the Match case check box in the Find and Replace dialog box.
- MatchWholeWord
Type: System.Object%
True to have the find operation locate only entire words, not text that is part of a larger word. Corresponds to the Find whole words only check box in the Find and Replace dialog box.
- MatchPrefix
Type: System.Object%
True to match words beginning with the search string. Corresponds to the Match prefix check box in the Find and Replace dialog box.
- MatchSuffix
Type: System.Object%
True to match words ending with the search string. Corresponds to the Match suffix check box in the Find and Replace dialog box.
- MatchPhrase
Type: System.Object%
True ignores all white space and control characters between words.
- MatchWildcards
Type: System.Object%
True to have the find text be a special search operator. Corresponds to the Use wildcards check box in the Find and Replace dialog box.
- MatchSoundsLike
Type: System.Object%
True to have the find operation locate words that sound similar to the find text. Corresponds to the Sounds like check box in the Find and Replace dialog box.
- MatchAllWordForms
Type: System.Object%
True to have the find operation locate all forms of the find text (for example, "sit" locates "sitting" and "sat"). Corresponds to the Find all word forms check box in the Find and Replace dialog box.
- MatchByte
Type: System.Object%
True to distinguish between full-width and half-width letters or characters during a search.
- MatchFuzzy
Type: System.Object%
True to use the nonspecific search options for Japanese text during a search. Read/write.
- MatchKashida
Type: System.Object%
True if find operations match text with matching kashidas in an Arabic-language document. This argument may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.
- MatchDiacritics
Type: System.Object%
True if find operations match text with matching diacritics in a right-to-left language document. This argument may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.
- MatchAlefHamza
Type: System.Object%
True if find operations match text with matching alef hamzas in an Arabic-language document. This argument may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.
- MatchControl
Type: System.Object%
True if find operations match text with matching bidirectional control characters in a right-to-left language document. This argument may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.
- IgnoreSpace
Type: System.Object%
True ignores all white space between words. Corresponds to the Ignore white-space characters check box in the Find and Replace dialog box.
- IgnorePunct
Type: System.Object%
True ignores all punctuation characters between words. Corresponds to the Ignore punctuation check box in the Find and Replace dialog box.
- HanjaPhoneticHangul
Type: System.Object%
True ignores phonetic hangul and hanja characters. Available only if you have support for Korean languages.
Return Value
Type: System.Boolean
Boolean
Remarks
The HitHighlight method applies primarily to search highlighting in Microsoft Office Outlook when Microsoft Office Word is specified as the e-mail editor. However, you can use this method on documents inside Word if you want to highlight found text. Otherwise, use the Execute(Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%, Object%) method.