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.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

bool MarkText(
	String^ Pattern,
	int vsFindOptionsValue = 0
)

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::Boolean

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

No code example is currently available or this language may not be supported.
Return to top
Show: