IMAPITable::QueryColumns

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Returns a list of columns for the table.

HRESULT QueryColumns(
ULONG ulFlags,
LPSPropTagArray FAR * lpPropTagArray
);

Parameters

  • ulFlags
    [in] Bitmask of flags that indicates which column set should be returned. The following flag can be set:

    • TBL_ALL_COLUMNS
      The table should return all available columns.
  • lpPropTagArray
    [out] Pointer to an SPropTagArray structure containing the property tags for the column set.

Return Value

  • S_OK
    The column set was successfully returned.

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

Remarks

The IMAPITable::QueryColumns method can be called to retrieve:

  • The default column set for a table.

  • The current column set for a table, as established by a call to the IMAPITable::SetColumns method.

  • The complete column set for a table, the columns that are available, but not necessarily part of the current set.

Notes to Callers

If you do not set the TBL_ALL_COLUMNS flag, IMAPITable::QueryColumns returns either a table's default or current column set, depending on whether the table has been affected by a call to IMAPITable::SetColumns. SetColumns changes the order and selection of columns in a table's column set.

If you set the TBL_ALL_COLUMNS flag, QueryColumns returns all of the columns that are capable of being in the table's column set.

Free the memory for the property tag array pointed to by the lpPropTagArray parameter by calling the MAPIFreeBuffer function.

MFCMAPI Reference

For MFCMAPI sample code, see the following table.

File

Function

Comment

ContentsTableListCtrl.cpp

CContentsTableListCtrl::DoSetColumns

MFCMAPI uses the IMAPITable::QueryColumns method to retrieve the current column set for a table so the user can edit it.

See Also

Reference

IMAPITable::SetColumns

MAPIFreeBuffer

SPropTagArray

IMAPITable : IUnknown

Concepts

MFCMAPI as a Code Sample