IMAPITable::GetCollapseState
Applies to: Outlook 2013 | Outlook 2016
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
);
Parameters
ulFlags
Reserved; must be zero.
cbInstanceKey
[in] The count of bytes in the instance key pointed to by the lpbInstanceKey parameter.
lpbInstanceKey
[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.
lpcbCollapseState
[out] A pointer to the count of structures pointed to by the lppbCollapseState parameter.
lppbCollapseState
[out] A pointer to a pointer to structures that contain data that describes the current table view.
Return value
S_OK
The state for the categorized table was successfully saved.
MAPI_E_BUSY
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.
MAPI_E_NO_SUPPORT
The table does not support categorization and expanded and collapsed views.
Remarks
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.
Notes to implementers
Store the current state of all nodes of a table in the lppbCollapseState parameter.
Notes to callers
Always call GetCollapseState before you call SetCollapseState.