ITextRangeProvider::GetAttributeValue method

Retrieves the value of the specified text attribute across the text range.

Syntax

HRESULT GetAttributeValue(
  TEXTATTRIBUTEID attributeId,
  VARIANT         *pRetVal
);

Parameters

attributeId

Type: TEXTATTRIBUTEID

The identifier of the text attribute. For a list of text attribute IDs, see Text Attribute Identifiers.

pRetVal

Type: VARIANT*

Receives one of the following.

  • The address of an object representing the value of the specified attribute. The data type of the value varies depending on the specified attribute. For example, if attributeId is UIA_FontNameAttributeId, GetAttributeValue returns a string that represents the font name of the text range, but if attributeId is UIA_IsItalicAttributeId, GetAttributeValue returns a boolean.
  • The address of the value retrieved by the UiaGetReservedMixedAttributeValue function, if the value of the specified attribute varies over the text range.
  • The address of the value retrieved by the UiaGetReservedNotSupportedValue function, if the specified attribute is not supported by the provider or the control.
This parameter is passed uninitialized.

Return Value

Type: HRESULT

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

Remarks

The GetAttributeValue method should retrieve the attribute value regardless of whether the text is hidden or visible.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header uiautomationcore.h (include UIAutomation.h)

See Also

Conceptual

ITextProvider

ITextRangeProvider

Reference

UI Automation Providers Overview