ITextProvider2::RangeFromAnnotation method

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

Syntax

HRESULT RangeFromAnnotation(
  IRawElementProviderSimple *annotationElement,
  ITextRangeProvider        **pRetVal
);

Parameters

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.

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

   
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