Runs the specified find operation. Returns True if the find operation is successful. Boolean.
Syntax
To open the Find pane from the Edit View, press Ctrl+F, or click Home Find. Find text by typing it in the Search the document for box. Word Web App starts searching as soon as you start typing. To further narrow the search results, click the magnifying glass and select one or both of the search options. Free word search puzzles that you can play online, and are printable. Do a word finder search. Results will display below. Find all words you can make using a particular set of letters, or find words in a word. This search is sensitive to the frequency of letters that you enter. If you want the resulting words to contain only one of any given letter, specify only one of that letter and set the blankcount to 0, since every blank that you use could potentially represent that letter. Find English words for crosswords and puzzle games. You can search by position of known letters, by anagrams or both. Choose the word length.
expression.Execute (FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace, MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl)
expression Required. A variable that represents a Find object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
FindText | Optional | Variant | The text to be searched for. 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. |
MatchCase | Optional | Variant | True to specify that the find text be case-sensitive. Corresponds to the Match case check box in the Find and Replace dialog box (Edit menu). |
MatchWholeWord | Optional | Variant | 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. |
MatchWildcards | Optional | Variant | 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 | Optional | Variant | 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 | Optional | Variant | 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. |
Forward | Optional | Variant | True to search forward (toward the end of the document). |
Wrap | Optional | Variant | Controls 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). This argument also controls what happens if there is a selection or range and the search text is not found in the selection or range. Can be one of the WdFindWrap constants. |
Format | Optional | Variant | True to have the find operation locate formatting in addition to, or instead of, the find text. |
ReplaceWith | Optional | Variant | The replacement text. To delete the text specified by the Find argument, use an empty string ('). You specify special characters and advanced search criteria just as you do for the Find argument. To specify a graphic object or other nontext item as the replacement, move the item to the Clipboard and specify '^c' for ReplaceWith. |
Replace | Optional | Variant | Specifies how many replacements are to be made: one, all, or none. Can be any WdReplace constant. |
MatchKashida | Optional | Variant | 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 | Optional | Variant | 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 | Optional | Variant | 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 | Optional | Variant | 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. |
MatchPrefix | Optional | Variant | True to match words beginning with the search string. Corresponds to the Match prefix check box in the Find and Replace dialog box. |
MatchSuffix | Optional | Variant | True to match words ending with the search string. Corresponds to the Match suffix check box in the Find and Replace dialog box. |
MatchPhrase | Optional | Variant | True ignores all white space and control characters between words. |
IgnoreSpace | Optional | Variant | True ignores all white space between words. Corresponds to the Ignore white-space characters check box in the Find and Replace dialog box. |
IgnorePunct | Optional | Variant | True ignores all punctuation characters between words. Corresponds to the Ignore punctuation check box in the Find and Replace dialog box. |
Return value
Boolean
Remarks
If MatchWildcards is True, you can specify wildcard characters and other advanced search criteria for the FindText argument. For example, '*(ing)' finds any word that ends in 'ing'.
To search for a symbol character, type a caret (^), a zero (0), and then the symbol's character code. For example, '^0151' corresponds to an em dash (—).
Unless otherwise specified, replacement text inherits the formatting of the text it replaces in the document. For example, if you replace the string 'abc' with 'xyz', occurrences of 'abc' with bold formatting are replaced with the string 'xyz' with bold formatting.
Also, if MatchCase is False, occurrences of the search text that are uppercase will be replaced with an uppercase version of the replacement text, regardless of the case of the replacement text. Using the previous example, occurrences of 'ABC' are replaced with 'XYZ'.
Example
Find In Word 2010
This example finds and selects the next occurrence of the word 'library'.
Find In Word Word Search
This example finds all occurrences of the word 'hi' in the active document and replaces each occurrence with 'hello'.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
If you have Word 2007 or a newer version, follow the instructions below to find Avery templates built in to Microsoft® Word.
Note: Older versions of Word are slightly different.
- With your Word document open, go to the top of screen and click Mailings > Labels > Options. (In older versions of Word, the Options setting is located in Tools at the top of the page.)
- Select Avery US Letter from the drop-down menu next to Label Vendors. Then scroll to find your Avery product number and click OK.
- If you want all your labels to have the same information, type it into the address box and click New Document. If you want different information on each label, click New Document and then proceed to fill in your labels.
- If your template looks like a blank page, select Layout > View Gridlines to see the template layout.
- If your product number isn't built in to your software, you can download the template instead.
See the tips and tricks for adding and editing text and pictures, clip art or other images in Avery templates for Microsoft® Word.