IUIAutomationTextPattern::RangeFromChild Method

Retrieves a text range enclosing a child element such as an image, hyperlink, Microsoft Excel spreadsheet, or other embedded object.

Syntax

HRESULT RangeFromChild(      
    IUIAutomationElement *child,
    IUIAutomationTextRange **range
);

Parameters

  • child
    [in] The address of the IUIAutomationElement interface of the enclosed child element.
  • range
    [out, retval] The address of a variable that receives a pointer to the IUIAutomationTextRange interface for the text range.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

If there is no text in the range that encloses the child element, a degenerate (empty) range is returned.

The child parameter is either a child of the element associated with a IUIAutomationTextPattern or from the array of children of a IUIAutomationTextRange.