ITextStoryRanges::Item method (tom.h)

Retrieves an ITextRange object for the Indexth story in this story collection.

Syntax

HRESULT Item(
  long       Index,
  ITextRange **ppRange
);

Parameters

Index

Type: LONG

Index of story range that is retrieved. The default value is 1, which indicates the first story in the collection. Count, given by ITextStoryRanges::GetCount, indicates the last story in the collection. If Index is less than zero, the stories are counted from last to first, with -1 being the index of the last story in the collection, and Index = - Count indicating the first story in the collection.

ppRange

Type: ITextRange**

The ITextRange object.

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 or Index is out of range.
E_FAIL
Failure for some other reason.

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

GetCount

ITextStoryRanges

Reference

Text Object Model