ITextRange::GetDuplicate method (tom.h)

Gets a duplicate of this range object.

Syntax

HRESULT GetDuplicate(
  ITextRange **ppRange
);

Parameters

ppRange

Type: ITextRange**

The duplicate of the range.

Return value

Type: HRESULT

The method returns an HRESULT value. If the method succeeds, it returns S_OK. If the method fails, it returns one of the following error codes. For more information about COM error codes, see Error Handling in COM.

Return code Description
E_INVALIDARG
ppRange is null.
E_FAIL
Failure for some other reason.

Remarks

To create an insertion point in order to traverse a range, first duplicate the range and then collapse the duplicate at its start character position. Note, a range is characterized by start and end character positions, and the story it belongs to.

Even if the range is actually an ITextSelection, the duplicate returned is an ITextRange. For an example, see the ITextRange::FindText method.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

Conceptual

FindText

ITextRange

Reference

Text Object Model