IUIAutomationTextPattern2::RangeFromAnnotation method

Retrieves a text range containing the text that is the target of the annotation associated with the specified annotation element.

Syntax

HRESULT RangeFromAnnotation(
  IUIAutomationElement   *annotation,
  IUIAutomationTextRange **range
);

Parameters

annotation

Type: IUIAutomationElement*

The annotation element for which to retrieve the target text. This element is a sibling of the element that implements IUIAutomationTextPattern2 for the document.

range

Type: IUIAutomationTextRange**

Receives a text range that contains the target text of the annotation.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

   
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See also

IUIAutomationTextPattern2

UI Automation Support for Textual Content

Working with Text-based Controls