Last modified: July 23, 2011

Applies to: Outlook

Inserts multiple table rows, possibly replacing existing rows.

HRESULT HrModifyRows(
  ULONG ulFlags,
  LPSRowSet lpSRowSet


[in] Reserved; must be zero.


[in] A pointer to an SRowSet structure that contains the set of rows to be added, replacing existing rows if necessary. One of the property value structures pointed to by the lpProps member of each SRow structure in the row set should contain the index column, the same value that was specified in the ulPropTagIndexColumn parameter in the call to the CreateTable function.


The rows were successfully inserted or modified.


One or more of the passed-in rows does not have an index column. If this error is returned, no rows are changed.

The ITableData::HrModifyRows method inserts the rows described by the SRowSet structure pointed to by the lpSRowSet parameter. If the index column value of a row in the row set matches the value for an existing row in the table, the existing row is replaced. If no row exists that matches the one included in the SRowSet structure, HrModifyRows adds the row to the end of the table.

All views of the table are modified to include the rows pointed to by lpSRowSet. However, if a view has a restriction in place that excludes a row, it may not be visible to the user.

The columns in the rows pointed to by lpSRowSet do not have to be in the same order as the columns in the table. The caller can also include as columns properties that are not currently in the table. For existing views, HrModifyRows makes these new columns available but does not include them in the current column set. For future views, HrModifyRows includes the new columns in the column set.

After HrModifyRows has added the rows, 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. MAPI sends TABLE_ROW_ADDED or TABLE_ROW_MODIFIED notifications for each row, up to eight rows. If more than eight rows are affected by the HrModifyRows call, MAPI sends a single TABLE_CHANGED notification instead.

© 2015 Microsoft