TextDocument::MarkText Method (String^, Int32)
Indicates whether or not the indicated text was found in the text document and creates unnamed bookmarks wherever matching text is found.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- Pattern
-
Type:
System::String^
Required. The text pattern to find.
- vsFindOptionsValue
-
Type:
System::Int32
Optional. A vsFindOptions constant that specifies the search text options.
Return Value
Type: System::BooleanA Boolean value true if the marked text was found in the text document, otherwise returns false.
MarkText searches the entire text document for Pattern, automatically creating unnamed bookmarks at each occurrence of Pattern.
The following examples look in a document (like a text file) for the word, int. If it is found, a bookmark is placed on its line. The examples then use the ClearBookmarks method to delete the bookmarks.
To run the following example, first either create or open a document that contains the word, int.