Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ITextRangeProvider::FindAttribute method

Returns a text range subset that has the specified text attribute value.

Syntax


HRESULT FindAttribute(
  [in]          TEXTATTRIBUTEID    attributeId,
  [in]          VARIANT            val,
  [in]          BOOL               backward,
  [out, retval] ITextRangeProvider **pRetVal
);

Parameters

attributeId [in]

Type: TEXTATTRIBUTEID

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

val [in]

Type: VARIANT

The attribute value to search for. This value must match the type specified for the attribute.

backward [in]

Type: BOOL

TRUE if the last occurring text range should be returned instead of the first; otherwise FALSE.

pRetVal [out, retval]

Type: ITextRangeProvider**

Receives a pointer to the text range having a matching attribute and attribute value; otherwise NULL.

Return value

Type: HRESULT

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

Remarks

The FindAttribute method retrieves matching text regardless of whether the text is hidden or visible. Clients can use UIA_IsHiddenAttributeId to check text visibility.

Requirements

Minimum supported client

Windows XP [desktop apps | UWP apps]

Minimum supported server

Windows Server 2003 [desktop apps | UWP apps]

Header

UIAutomationCore.h (include UIAutomation.h)

IDL

UIAutomationCore.idl

See also

Reference
ITextProvider
ITextRangeProvider
Conceptual
UI Automation Providers Overview

 

 

Show:
© 2018 Microsoft