Last modified: July 23, 2011

Applies to: Outlook

Retrieves a row based on its position in the table.

  ULONG ulRowNumber,
  LPSRow FAR * lppSRow


[in] The number of the row for which to return properties. The value in the ulRowNumber parameter can be any value from 0, which indicates the first row in the table, through n – 1, which indicates the last row in the table.


[out] A pointer to a pointer to an SRow structure that describes the target row.


The row was retrieved successfully, or a row for the row number specified by the ulRowNumber parameter does not exist.

The ITableData::HrEnumRow method retrieves a row based on a sequential number. This number represents the order of insertion (0 indicates the first row, and the number of rows minus 1 indicates the last row). MAPI maintains this chronological order of row insertion for the lifetime of the table data object.

If the number specified in ulRowNumber does not correspond to a row in the table, HrEnumRow returns S_OK and sets the lppSRow parameter to NULL.

MAPI allocates memory for the returned SRow structure by using the MAPIAllocateBuffer function when the table data object is created. The caller must release this memory by calling the MAPIFreeBuffer function.

To retrieve rows from a table in the order that they were inserted, table data object users call the HrEnumRow method.