IMAPISession::OpenProfileSection
Last modified: July 23, 2011
Applies to: Outlook
Opens a section of the current profile and returns an IProfSect pointer for further access.
HRESULT OpenProfileSection( LPMAPIUID lpUID, LPCIID lpInterface, ULONG ulFlags, LPPROFSECT FAR * lppProfSect );
The IMAPISession::OpenProfileSection method opens a profile section or object that supports the IProfSect interface. Profile sections are used for reading information from and writing information to the session profile.
You cannot use OpenProfileSection to open profile sections that individual service providers own unless you specify MAPI_FORCE_ACCESS in the ulFlags parameter.
Multiple clients can open a profile section with read-only permission, but only one client can open a profile section with read/write permission. If another client has a profile section open that you attempt to open by calling OpenProfileSection with the MAPI_MODIFY flag set, the call will fail, returning MAPI_E_NO_ACCESS.
A read-only open operation fails if the section is open for writing.
You can create a profile section by calling OpenProfileSection with the MAPI_MODIFY flag and a nonexistent MAPIUID structure in the lpUID parameter. Be sure that you specify MAPI_MODIFY. If you set lpUID to point to a nonexistent MAPIUID and OpenProfileSection is set to use the default access mode of read-only, the call will fail with MAPI_E_NOT_FOUND.