War diese Seite hilfreich?
Ihr Feedback ist uns wichtig. Teilen Sie uns Ihre Meinung mit.
Weiteres Feedback?
1500 verbleibende Zeichen
Exportieren (0) Drucken
Alle erweitern

Find.Execute Method

Runs the specified find operation.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

'Usage
Dim FindText As Object
Dim MatchCase As Object
Dim MatchWholeWord As Object
Dim MatchWildcards As Object
Dim MatchSoundsLike As Object
Dim MatchAllWordForms As Object
Dim Forward As Object
Dim Wrap As Object
Dim Format As Object
Dim ReplaceWith As Object
Dim Replace As Object
Dim MatchKashida As Object
Dim MatchDiacritics As Object
Dim MatchAlefHamza As Object
Dim MatchControl As Object
Dim returnValue As Boolean
Dim find1 As Find
returnValue = find1.Execute(FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace, MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl)

bool Execute(
	[In, Optional] ref object FindText, 
	[In, Optional] ref object MatchCase, 
	[In, Optional] ref object MatchWholeWord, 
	[In, Optional] ref object MatchWildcards, 
	[In, Optional] ref object MatchSoundsLike, 
	[In, Optional] ref object MatchAllWordForms, 
	[In, Optional] ref object Forward, 
	[In, Optional] ref object Wrap, 
	[In, Optional] ref object Format, 
	[In, Optional] ref object ReplaceWith, 
	[In, Optional] ref object Replace, 
	[In, Optional] ref object MatchKashida, 
	[In, Optional] ref object MatchDiacritics, 
	[In, Optional] ref object MatchAlefHamza, 
	[In, Optional] ref object MatchControl
);
public boolean Execute(
	/*in*/System.Object FindText, 
	/*in*/System.Object MatchCase, 
	/*in*/System.Object MatchWholeWord, 
	/*in*/System.Object MatchWildcards, 
	/*in*/System.Object MatchSoundsLike, 
	/*in*/System.Object MatchAllWordForms, 
	/*in*/System.Object Forward, 
	/*in*/System.Object Wrap, 
	/*in*/System.Object Format, 
	/*in*/System.Object ReplaceWith, 
	/*in*/System.Object Replace, 
	/*in*/System.Object MatchKashida, 
	/*in*/System.Object MatchDiacritics, 
	/*in*/System.Object MatchAlefHamza, 
	/*in*/System.Object MatchControl
);
function Execute(
	 FindText : Object, 
	 MatchCase : Object, 
	 MatchWholeWord : Object, 
	 MatchWildcards : Object, 
	 MatchSoundsLike : Object, 
	 MatchAllWordForms : Object, 
	 Forward : Object, 
	 Wrap : Object, 
	 Format : Object, 
	 ReplaceWith : Object, 
	 Replace : Object, 
	 MatchKashida : Object, 
	 MatchDiacritics : Object, 
	 MatchAlefHamza : Object, 
	 MatchControl : Object
) : Boolean;

Parameters

FindText

Optional Object. 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 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 (Edit menu).

MatchWholeWord

Optional Object. True to have the find operation locate only entire words, not text that's part of a larger word. Corresponds to the Find whole words only check box in the Find and Replace dialog box.

MatchWildcards

Optional 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

Optional 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

Optional 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.

Forward

Optional Object. True to search forward (toward the end of the document).

Wrap

Optional Object. 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's a selection or range and the search text isn't found in the selection or range.

Can be one of the following WdFindWrap constants:

wdFindAsk After searching the selection or range, Microsoft Word displays a message asking whether to search the remainder of the document.

wdFindContinue The find operation continues if the beginning or end of the search range is reached.

wdFindStop The find operation ends if the beginning or end of the search range is reached.

Format

Optional Object. True to have the find operation locate formatting in addition to or instead of the find text.

ReplaceWith

Optional Object. 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 non-text item as the replacement, move the item to the Clipboard and specify "^c" for ReplaceWith.

Replace

Optional Object. Specifies how many replacements are to be made: one, all, or none. Can be any WdReplace constant:

wdReplaceAll

wdReplaceNone

wdReplaceOne

MatchKashida

Optional 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’ve selected or installed.

MatchDiacritics

Optional 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’ve selected or installed.

MatchAlefHamza

Optional 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’ve selected or installed.

MatchControl

Optional 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’ve selected or installed.

This method returns True if the find operation is successful.

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 search and replacement text. Using the previous example, occurrences of "ABC" are replaced with "XYZ."


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Anzeigen:
© 2015 Microsoft