TextPatternRange::FindAttribute Method (AutomationTextAttribute^, Object^, Boolean)


Returns a text range subset that has the specified attribute value.

Namespace:   System.Windows.Automation.Text
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

TextPatternRange^ FindAttribute(
	AutomationTextAttribute^ attribute,
	Object^ value,
	bool backward


Type: System.Windows.Automation::AutomationTextAttribute^

The attribute to search for.

Type: System::Object^

The attribute value to search for. This value must match the type specified for the attribute.

Type: System::Boolean

true if the last occurring text range should be returned instead of the first; otherwise false.

Return Value

Type: System.Windows.Automation.Text::TextPatternRange^

A text range having a matching attribute and attribute value; otherwise null (Nothing in Microsoft Visual Basic .NET).

There is no differentiation between hidden and visible text. UI Automation clients can use IsHiddenAttribute to check text visibility.


Use DocumentRange to search the entire document.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top