Export (0) Print
Expand All

Find.HitHighlight Method

Office 2007
Highlights all found matches and returns a Boolean that represents whether matches were found.

Syntax

expression.HitHighlight(FindText, HighlightColor, TextColor, MatchCase, MatchWholeWord, MatchPrefix, MatchSuffix, MatchPhrase, MatchWildcards, MatchSoundsLike, MatchAllWordForms, MatchByte, MatchFuzzy, MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl, IgnoreSpace, IgnorePunct, HanjaPhoneticHangul)

expression   An expression that returns a Find object.

Parameters

NameRequired/OptionalData TypeDescription
FindTextRequiredVariantSpecifies 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.
HighlightColorOptionalVariantSpecifies the highlight color for the text. Can be any RGB color or one of the WdColor constants.
TextColorOptionalVariantSpecifies the color of the text. Can be any RGB color or one of the WdColor constants.
MatchCaseOptionalVariantTrue to specify that the find text be case-sensitive. Corresponds to the Match case check box in the Find and Replace dialog box.
MatchWholeWordOptionalVariantTrue 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.
MatchPrefixOptionalVariantTrue to match words beginning with the search string. Corresponds to the Match prefix check box in the Find and Replace dialog box.
MatchSuffixOptionalVariantTrue to match words ending with the search string. Corresponds to the Match suffix check box in the Find and Replace dialog box.
MatchPhraseOptionalVariantTrue ignores all white space and control characters between words.
MatchWildcardsOptionalVariantTrue to have the find text be a special search operator. Corresponds to the Use wildcards check box in the Find and Replace dialog box.
MatchSoundsLikeOptionalVariantTrue 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.
MatchAllWordFormsOptionalVariantTrue 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.
MatchByteOptionalVariantTrue to distinguish between full-width and half-width letters or characters during a search.
MatchFuzzyOptionalVariantTrue to use the nonspecific search options for Japanese text during a search. Read/write.
MatchKashidaOptionalVariantTrue 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.
MatchDiacriticsOptionalVariantTrue 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.
MatchAlefHamzaOptionalVariantTrue 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.
MatchControlOptionalVariantTrue 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.
IgnoreSpaceOptionalVariantTrue ignores all white space between words. Corresponds to the Ignore white-space characters check box in the Find and Replace dialog box.
IgnorePunctOptionalVariantTrue ignores all punctuation characters between words. Corresponds to the Ignore punctuation check box in the Find and Replace dialog box.
HanjaPhoneticHangulOptionalVariantTrue ignores phonetic hangul and hanja characters. Available only if you have support for Korean languages.

Return Value
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 method.




Community Additions

ADD
Show:
© 2014 Microsoft