You receive an "MAPI_E_NO_ACCESS" error message when you use the OpenProfileSection method in Outlook 2003 (822977)



The information in this article 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 "Symptoms" 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:
#define MAPI_FORCE_ACCESS 0x00080000
 
hRes = m_lpProviderAdmin->OpenProfileSection(
  (LPMAPIUID) lpProviderUID->lpb,
  NULL,
  MAPI_MODIFY | MAPI_FORCE_ACCESS,
  (LPPROFSECT*) lppMAPIProp);

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

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


Modification Type:MinorLast Reviewed:1/6/2006
Keywords:kbProgramming kbfunctions kberrmsg kbpending kbprb KB822977 kbAudDeveloper