TextPatternRange.FindAttribute Method (AutomationTextAttribute, Object, Boolean)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

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

member FindAttribute : 
        attribute:AutomationTextAttribute *
        value:Object *
        backward:bool -> TextPatternRange


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