Platforms to show: All Mac Windows Linux Cross-Platform
Back to UIAutomationTextRangeMBS class.
UIAutomationTextRangeMBS.AddToSelection
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
The text insertion point moves to the newly selected text. If AddToSelection is called on a text range object that represents a degenerate (empty) text range, the text insertion point moves to the starting endpoint of the text range.
UIAutomationTextRangeMBS.AttributeValue(AttributeId as Integer) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
AttributeId: The identifier of the text attribute.
UIAutomationTextRangeMBS.AttributeValues(AttributeIds() as Integer) as String()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
This is equivalent to calling GetAttributeValue, except it can retrieve multiple values instead of just one.
attributeIds: A list of text attribute identifiers.
GetAttributeValues only gets the text attributes that are supplied in the call.
UIAutomationTextRangeMBS.BoundingRectangles as UIAutomationRectMBS()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns an array of bounding rectangles for each fully or partially visible line of text in a text range. An empty array is returned for a degenerate (empty) text range or for a text range that is completely off-screen, scrolled out of view, or obscured by an overlapping window.
UIAutomationTextRangeMBS.ChildrenBuildCache(cacheRequest as UIAutomationCacheRequestMBS) as UIAutomationElementArrayMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
This is equivalent to calling GetChildren, but adds the standard build cache pattern.
cacheRequest: An UIAutomationCacheRequestMBS specifying the properties and control patterns to be cached.
Returns the children, and each child’s properties or patterns, of the text range that meet the criteria of the supplied cacheRequest.
Following the design of GetChildren
- Children that overlap with the text range, but are not entirely enclosed by it will also be included.
- When no children exist, an empty collection is returned.
UIAutomationTextRangeMBS.Clone as UIAutomationTextRangeMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
The new range can be manipulated independently of the original.
UIAutomationTextRangeMBS.Compare(other as UIAutomationTextRangeMBS) as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Receives TRUE if the text ranges have the same endpoints, or FALSE if they do not.
This method compares the endpoints of the two text ranges, not the text in the ranges. The ranges are identical if they share the same endpoints. If two text ranges have different endpoints, they are not identical even if the text in both ranges is exactly the same.
UIAutomationTextRangeMBS.CompareEndpoints(srcEndPoint as Integer, Range as UIAutomationTextRangeMBS, targetEndPoint as Integer) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
srcEndPoint: A value indicating whether the start or end endpoint of this text range is to be compared.
range: the text range to compare.
targetEndPoint: A value indicating whether the start or end endpoint of range is to be compared.
Receives a negative value if the caller's endpoint occurs earlier in the text than the target endpoint; 0 if the caller's endpoint is at the same location as the target endpoint; or a positive value if the caller's endpoint occurs later in the text than the target endpoint.
UIAutomationTextRangeMBS.Constructor Private
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
UIAutomationTextRangeMBS.Destructor
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
UIAutomationTextRangeMBS.EnclosingElementBuildCache(cacheRequest as UIAutomationCacheRequestMBS) as UIAutomationElementMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
This is equivalent to calling GetChildren, but adds the standard build cache pattern.
cacheRequest: An UIAutomationCacheRequestMBS specifying the properties and control patterns to be cached.
Returns the children, and each child’s properties or patterns, of the text range that meet the criteria of the supplied cacheRequest.
Following the design of GetChildren
- Children that overlap with the text range, but are not entirely enclosed by it will also be included.
- When no children exist, an empty collection is returned.
UIAutomationTextRangeMBS.ExpandToEnclosingUnit(textUnit as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
The range is expanded if it is smaller than the specified unit, or shortened if it is longer than the specified unit.
textUnit: The text unit, such as line or paragraph.
Client applications such as screen readers use this method to retrieve the full word, sentence, or paragraph that exists at the insertion point or caret position.
UIAutomationTextRangeMBS.FindAttribute(AttributeId as Integer, Value as Variant, backward as Boolean) as UIAutomationTextRangeMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
AttributeId: The identifier of the text attribute for the text range subset being retrieved. For a list of text attribute IDs, see Text Attribute Identifiers.
Value: The value of the attribute. This value must match the type specified for the attribute.
backward: TRUE if the last occurring text range should be returned instead of the first; otherwise FALSE.
Returns the text range having a matching attribute and attribute value; otherwise nil.
The FindAttribute method retrieves matching text regardless of whether the text is hidden or visible. Use UIA_IsHiddenAttributeId to check text visibility.
UIAutomationTextRangeMBS.FindText(text as String, backward as Boolean, ignoreCase as Boolean) as UIAutomationTextRangeMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
text: The text to find.
backward: TRUE if the last occurring text range should be returned instead of the first; otherwise FALSE.
ignoreCase: TRUE if case should be ignored; otherwise FALSE.
Returns the text range, or nil if no match is found.
There is no differentiation between hidden and visible text.
UIAutomationTextRangeMBS.Move(textUnit as Integer, count as Integer) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
textUnit: A value specifying the type of text units, such as character, word, paragraph, and so on.
Count: The number of text units to move. A positive value moves the text range forward. A negative value moves the text range backward. Zero has no effect.
Returns the number of text units actually moved. This can be less than the number requested if either of the new text range endpoints is greater than or less than the endpoints retrieved by the DocumentRange method. This value can be negative if navigation is happening in the backward direction.
see also
https://learn.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-move
UIAutomationTextRangeMBS.MoveEndpointByRange(srcEndPoint as Integer, Range as UIAutomationTextRangeMBS, targetEndPoint as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
srcEndPoint: An endpoint (either start or end) of the current text range. This is the endpoint to be moved.
range: A second text range from the same text provider as the current text range.
targetEndPoint: An endpoint (either start or end) of the second text range. The srcEndPoint of the current text range is moved to this endpoint.
If the endpoint being moved crosses the other endpoint of the same text range, that other endpoint is moved also, resulting in a degenerate (empty) range and ensuring the correct ordering of the endpoints (that is, the start is always less than or equal to the end).
UIAutomationTextRangeMBS.MoveEndpointByUnit(endpoint as Integer, textUnit as Integer, count as Integer) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
endpoint: A value specifying the endpoint (start or end) to move.
unit: A value specifying the textual unit for moving, such as line or paragraph.
count: The number of units to move. A positive count moves the endpoint forward. A negative count moves backward. A count of 0 has no effect.
Returns the count of units actually moved. This value can be less than the number requested if moving the endpoint runs into the beginning or end of the document.
see also
https://learn.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-moveendpointbyunit
UIAutomationTextRangeMBS.RemoveFromSelection
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
The text insertion point moves to the area of the removed highlight. Providing a degenerate text range also moves the insertion point.
UIAutomationTextRangeMBS.ScrollIntoView(alignToTop as Boolean)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
alignToTop: TRUE if the text control should be scrolled so that the text range is flush with the top of the viewport; FALSE if it should be flush with the bottom of the viewport.
The method respects both hidden and visible text. If the text range is hidden, the text control will scroll only if the hidden text has an anchor in the viewport.
A Microsoft UI Automation client can check text visibility by calling GetAttributeValue with the attr parameter set to UIA_IsHiddenAttributeId.
UIAutomationTextRangeMBS.SelectText
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
If the Select method is called on a text range object that represents a degenerate (empty) text range, the text insertion point moves to the starting endpoint of the text range.
UIAutomationTextRangeMBS.ShowContextMenu
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
This method returns an error code if the context menu could not be invoked. If no context menu is available directly on the text range on which it was invoked, the Microsoft UI Automation system might attempt to invoke a context menu on the UI Automation parent of the current item.
The context menus themselves fire menu opened / closed events when they are invoked and dismissed.
Requires Windows 8.1.
UIAutomationTextRangeMBS.Text(maxLength as Integer = -1) as String
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | UIAutomation | MBS WinFrameworks Plugin | 26.2 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
maxLength: The maximum length of the string to return, or -1 if no limit is required.
Returns the string, possibly truncated at the specified maxLength.
The items on this page are in the following plugins: MBS WinFrameworks Plugin.