共用方式為


IAddrBook::GetPAB

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Returns the entry identifier of the container that is designated as the personal address book (PAB).

HRESULT GetPAB(
  ULONG FAR * lpcbEntryID,
  LPENTRYID FAR * lppEntryID
);

Parameters

  • lpcbEntryID
    [out] A pointer to the byte count in the entry identifier pointed to by the lppEntryID parameter.

  • lppEntryID
    [out] A pointer to a pointer to the entry identifier of the PAB. The lppEntryID parameter contains zero if no container has been designated as the PAB.

Return Value

  • S_OK
    The entry identifier of the PAB was successfully returned.

Remarks

Clients call the GetPAB method to retrieve the entry identifier of the container designated as the PAB. If a PAB has not been established in the profile, MAPI selects as the PAB the first container in the address book hierarchy that allows modifications.

MFCMAPI Reference

For MFCMAPI sample code, see the following table.

File

Function

Comment

MainDlg.cpp

CMainDlg::OnOpenPAB

MFCMAPI uses the GetPAB method to get the ID for the user’s personal address book.

See Also

Reference

MAPIAllocateBuffer

MAPIFreeBuffer

PidTagContainerFlags Canonical Property

IAddrBook : IMAPIProp

Concepts

MFCMAPI as a Code Sample