Class Find (Word VBA)
The class Find represents the criteria for a find operation.
To use a Find class variable it first needs to be instantiated, for example
Dim fnd as Find Set fnd = Selection.Find
The following procedures in this class have been grouped together and are described on a separate theme page
Execute - Runs the specified find operation. Returns True if the find operation is successful.
Dim booExecute As Boolean booExecute = Selection.Find.Execute()
Execute2007 - Runs the specified find operation. Returns True if the find operation is successful.
Dim booExecute2007 As Boolean booExecute2007 = Selection.Find.Execute2007()
HitHighlight - Highlights all found matches and returns a Boolean that represents whether matches were found.
Dim strFindText As String: strFindText = Dim booHitHighlight As Boolean booHitHighlight = Selection.Find.HitHighlight(FindText:=strFindText)
CorrectHangulEndings true if Microsoft Word automatically corrects Hangul endings when replacing Hangul text.
Selection.Find.CorrectHangulEndings = True
Forward true if the find operation searches forward through the document.
Selection.Find.Forward = True
Found true if the search produces a match.
Dim booFound As Boolean booFound = Selection.Find.Found
Frame returns a Frame object that represents the frame formatting for the specified style or find-and-replace operation.
Dim frmFrame As Frame Set frmFrame = Selection.Find.Frame
HanjaPhoneticHangul returns or sets a Boolean that represents whether to locate phonetic Hangul and hanja characters in a Korean language find operation.
Selection.Find.HanjaPhoneticHangul = True
Highlight true if highlight formatting is included in the find criteria.
IgnorePunct returns or sets a Boolean that represents whether a find operation should ignore punctuation in found text.
Selection.Find.IgnorePunct = True
IgnoreSpace returns or sets a Boolean that represents whether a find operation should ignore extra white space in found text.
Selection.Find.IgnoreSpace = True
LanguageID returns or sets the language for the specified Find object.
Selection.Find.LanguageID = wdAfrikaans
LanguageIDFarEast returns or sets an East Asian language for the specified object.
Selection.Find.LanguageIDFarEast = wdAfrikaans
LanguageIDOther returns or sets the language for the specified object.
Selection.Find.LanguageIDOther = wdAfrikaans
MatchAlefHamza true if find operations match text with matching alef hamzas in an Arabic language document.
Selection.Find.MatchAlefHamza = True
MatchAllWordForms true if all forms of the text to find are found by the find operation (for instance, if the text to find is "sit," "sat" and "sitting" are found as well).
Selection.Find.MatchAllWordForms = True
MatchByte true if Microsoft Word distinguishes between full-width and half-width letters or characters during a search.
Selection.Find.MatchByte = True
MatchCase true if the find operation is case-sensitive. The default is False.
Selection.Find.MatchCase = True
MatchControl true if find operations match text with matching bidirectional control characters in a right-to-left language document.
Selection.Find.MatchControl = True
MatchDiacritics true if find operations match text with matching diacritics in a right-to-left language document.
Selection.Find.MatchDiacritics = True
MatchFuzzy true if Microsoft Word uses the nonspecific search options for Japanese text during a search.
Selection.Find.MatchFuzzy = True
MatchKashida true if find operations match text with matching kashidas in an Arabic language document.
Selection.Find.MatchKashida = True
MatchPhrase true ignores all white space and control characters between words.
Selection.Find.MatchPhrase = True
MatchPrefix true to match words beginning with the search string.
Selection.Find.MatchPrefix = True
MatchSoundsLike true if words that sound similar to the text to find are returned by the find operation.
Selection.Find.MatchSoundsLike = True
MatchSuffix true to match words ending with the search string.
Selection.Find.MatchSuffix = True
MatchWholeWord true if the find operation locates only entire words and not text that's part of a larger word.
Selection.Find.MatchWholeWord = True
MatchWildcards true if the text to find contains wildcards.
Selection.Find.MatchWildcards = True
NoProofing true if Microsoft Word finds or replaces text that the spelling and grammar checker ignores.
Parent returns an object that represents the parent object of the specified Find object.
Dim objParent As Object Set objParent = Selection.Find.Parent
Replacement returns a Replacement object that contains the criteria for a replace operation.
Dim rplReplacement As Replacement Set rplReplacement = Selection.Find.Replacement
Text returns or sets the text to find.
Wrap returns or sets what happens if the search begins at a point other than the beginning of the document and the end of the document is reached (or vice versa if Forward is set to False) or if the search text isn't found in the specified selection or range.
Selection.Find.Wrap = wdFindAsk