Partager via


ITableData::HrInsertRow

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Inserts a table row.

HRESULT HrInsertRow(
  ULONG uliRow,
  LPSRow lpSRow
);

Parameters

  • uliRow
    [in] A sequential row number that represents a specific row. The new row will be placed after the row that the number indicates. The uliRow parameter can contains row numbers from 0 through n, where n is the total number of rows in the table. Passing n in uliRow appends the row to the end of the table.

  • lpSRow
    [in] A pointer to an SRow structure that describes the row to be inserted.

Return Value

  • S_OK
    The row was successfully inserted.

  • MAPI_E_INVALID_PARAMETER
    A row that has the same value for its index column as the row to be inserted already exists in the table.

Remarks

The ITableData::HrInsertRow method inserts a row into a table at a particular position. The new row is inserted after the row that is in the position specified by the uliRow parameter.

If uliRow is set to the number of rows in the table, the new row is appended to the end of the table.

The property that acts as the index column for the table must be included in the lpProps member of the SRow structure pointed to by the lpSRow parameter. This index property, typically PR_INSTANCE_KEY (PidTagInstanceKey), is used to uniquely identify the row for future maintenance tasks.

The property columns in the SRow structure do not have to be in the same order as the property columns in the table.

After the row is inserted, notifications are sent to all clients or service providers that have a view of the table and that have called the table's IMAPITable::Advise method to register for notifications. No notification is sent if the inserted row is not included in the view due to a restriction.

See Also

Reference

SRow

TABLE_NOTIFICATION

ITableData : IUnknown