Microsoft KB Archive/822977

= You receive an &quot;MAPI_E_NO_ACCESS&quot; error message when you use the OpenProfileSection method in Outlook 2003 =

Article ID: 822977

Article Last Modified on 1/6/2006

-

APPLIES TO


 * Microsoft Office Outlook 2003

-



SYMPTOMS
When you use the technique that is documented in the following Microsoft Knowledge Base article to try to access a profile section that does not belong to your provider or client by using the OpenProfileSection method in Outlook 2003

228736 SAMPLE: Profman2.exe - MAPI Profile Manager v2.0

you may receive the following error message followed by an access volation:

MAPI_E_NO_ACCESS

Additionally, you cannot use the Profman workaround that is referenced in the previously mentioned Microsoft Knowledge Base article to access the IProfSect object (including both the IMsgServiceAdmin::OpenProfileSection and the IProviderAdmin::OpenProfileSection objects).



CAUSE
This behavior occurs because the technique that is documented in the Microsoft Knowledge Base article that is mentioned in the &quot;Symptoms&quot; section of this article is not supported in Outlook 2003. This technique is ineffective because of the changes that were made to the IProviderAdmin object in Outlook 2003.



RESOLUTION
To resolve this behavior, use the following supported flag that was added in Microsoft Outlook 2002 in the OpenProfileSection method for both the IMsgServiceAdmin and the IProviderAdmin objects when you write third-party program add-ins in Outlook 2003: hRes = m_lpProviderAdmin->OpenProfileSection( (LPMAPIUID) lpProviderUID->lpb,  NULL,  MAPI_MODIFY | MAPI_FORCE_ACCESS,  (LPPROFSECT*) lppMAPIProp);
 * 1) define MAPI_FORCE_ACCESS 0x00080000

