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)

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

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.

Community Additions

ADD
Show: