ITextRangeProvider Interface


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

Exposes methods and properties to support UI Automation client access to a span of continuous text in a text container that implements ITextProvider.

Namespace:   System.Windows.Automation.Provider
Assembly:  UIAutomationProvider (in UIAutomationProvider.dll)

Public Interface ITextRangeProvider


Adds to the collection of highlighted text in a text container that supports multiple, disjoint selections.


Returns a new ITextRangeProvider identical to the original ITextRangeProvider and inheriting all properties of the original.


Returns a value that indicates whether the span (the Start endpoint to the End endpoint) of a text range is the same as another text range.

System_CAPS_pubmethodCompareEndpoints(TextPatternRangeEndpoint, ITextRangeProvider, TextPatternRangeEndpoint)

Returns a value that specifies whether two text ranges have identical endpoints.


Expands the text range to the specified text unit.

System_CAPS_pubmethodFindAttribute(Int32, Object, Boolean)

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

System_CAPS_pubmethodFindText(String, Boolean, Boolean)

Returns a text range subset that contains the specified text.


Retrieves the value of the specified attribute across the text range.


Retrieves a collection of bounding rectangles for each fully or partially visible line of text in a text range.


Retrieves a collection of all embedded objects that fall within the text range.


Returns the innermost control that encloses the text range.


Retrieves the plain text of the range.

System_CAPS_pubmethodMove(TextUnit, Int32)

Moves the text range the specified number of text units.

System_CAPS_pubmethodMoveEndpointByRange(TextPatternRangeEndpoint, ITextRangeProvider, TextPatternRangeEndpoint)

Moves one endpoint of a text range to the specified endpoint of a second text range.

System_CAPS_pubmethodMoveEndpointByUnit(TextPatternRangeEndpoint, TextUnit, Int32)

Moves one endpoint of the text range the specified number of text units within the document range.


Removes a highlighted section of text, corresponding to the caller's Start and End endpoints, from the collection of highlighted text in a text container that supports multiple, disjoint selections.


Causes the text control to scroll vertically until the text range is visible in the viewport.


Highlights text in the text control corresponding to the text range Start and End endpoints.

Implemented on a UI Automation provider that must support the TextPattern control pattern.

A TextPatternRange can represent an insertion point, a subset, or all of the text in a TextPattern container.

.NET Framework
Available since 3.0
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Return to top