MSDN Library

ITextRangeProvider::GetAttributeValue Method

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


HRESULT GetAttributeValue(          TEXTATTRIBUTEID attributeId,
    VARIANT *pRetVal


[in] The identifier of the text attribute. For a list of text attribute IDs, see Text Attribute Identifiers.
[out, retval] The address of a VARIANT that receives one of the following.
  • The address of an object representing the value of the specified attribute. For example, GetAttributeValue(TextPattern.FontNameAttribute) would return a string that represents the font name of the text range while GetAttributeValue(TextPattern.IsItalicAttribute) would return a Boolean.
  • The address of UiaGetReservedMixedAttributeValue if the value of the specified attribute varies over the text range.
  • UiaGetReservedNotSupportedValue if the specified attribute is not supported by the provider or the control.

This parameter is passed uninitialized.

Return Value

Returns S_OK if successful, or an error value otherwise.


There is no differentiation between hidden and visible text.

See Also

Community Additions

© 2016 Microsoft