Last modified: July 23, 2011

Applies to: Outlook

Returns the data that is needed to rebuild the current collapsed or expanded state of a categorized table.

HRESULT GetCollapseState(
ULONG ulFlags,
ULONG cbInstanceKey,
LPBYTE lpbInstanceKey,
ULONG FAR * lpcbCollapseState,
LPBYTE FAR * lppbCollapseState


Reserved; must be zero.


[in] The count of bytes in the instance key pointed to by the lpbInstanceKey parameter.


[in] A pointer to the PR_INSTANCE_KEY (PidTagInstanceKey) property of the row at which the current collapsed or expanded state should be rebuilt. The lpbInstanceKey parameter cannot be NULL.


[out] A pointer to the count of structures pointed to by the lppbCollapseState parameter.


[out] A pointer to a pointer to structures that contain data that describes the current table view.


The state for the categorized table was successfully saved.


Another operation is in progress that prevents the operation from starting. Either the operation in progress should be allowed to complete or it should be stopped.


The table does not support categorization and expanded and collapsed views.

The IMAPITable::GetCollapseState method works with the IMAPITable::SetCollapseState method to change the user's view of a categorized table. GetCollapseState saves the data that is needed for SetCollapseState to use to rebuild the appropriate views of the categories of a categorized table. Service providers determine the data to be saved. However, most service providers implementing GetCollapseState save the following:

  • The sort keys (standard columns and category columns).

  • Information about the row that the instance key represents.

  • Information to restore the collapsed and expanded categories of the table.

For more information about categorized tables, see Sorting and Categorization.

Store the current state of all nodes of a table in the lppbCollapseState parameter.

Always call GetCollapseState before you call SetCollapseState.