ITextProvider2::RangeFromAnnotation method (uiautomationcore.h)

Exposes a text range that contains the text that is the target of the annotation associated with the specified annotation element.

Syntax

HRESULT RangeFromAnnotation(
  [in]          IRawElementProviderSimple *annotationElement,
  [out, retval] ITextRangeProvider        **pRetVal
);

Parameters

[in] annotationElement

Type: IRawElementProviderSimple*

The provider for an element that implements the IAnnotationProvider interface. The annotation element is a sibling of the element that implements the ITextProvider2 interface for the document.

[out, retval] pRetVal

Type: ITextRangeProvider**

Receives a text range that contains the annotation target text.

Return value

Type: HRESULT

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

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header uiautomationcore.h (include UIAutomation.h)

See also

Document Control Type

ITextProvider

ITextProvider2

UI Automation Providers Overview

UI Automation Support for Textual Content