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::GetText method

Retrieves the plain text of the range.

Syntax


HRESULT GetText(
  [in]           int maxLength,
  [out, retval]  BSTR *pRetVal
);

Parameters

maxLength [in]

Type: int

The maximum length of the string to return. Use -1 if no limit is required.

pRetVal [out, retval]

Type: BSTR*

Receives the plain text of the text range, possibly truncated at the specified maximum length. 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

ITextRangeProvider::GetText retrieves both hidden and visible text.

If maxLength is greater than the length of the text span of the caller, the string returned will be the plain text of the text range.

ITextRangeProvider::GetText will not be affected by the order of endpoints in the text flow; it will always return the text between the start and end endpoints of the text range in the logical text flow order.

Requirements

Minimum supported client

Windows XP [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

UIAutomationCore.h (include UIAutomation.h)

IDL

UIAutomationCore.idl

See also

Reference
ITextProvider
ITextRangeProvider
Conceptual
UI Automation Providers Overview

 

 

Community Additions

Show:
© 2014 Microsoft. All rights reserved.