Hi,
Initially I was using Outlook 2003. When I tried to retrieve some e-mail information like the name of the sender, Outlook would pop up the Address Book Access Prompt window asking me if I want to let the program access e-mail address information.
Now I have Outlook 2007. When I run the program, Outlook does not display the Address Book Access Prompt window. Instead it gives an Access Denied exception. I want to make the Address Book Access Prompt window visible as it used to in Outlook 2003.
Initially I was using Outlook 2003. When I tried to retrieve some e-mail information like the name of the sender, Outlook would pop up the Address Book Access Prompt window asking me if I want to let the program access e-mail address information.
Now I have Outlook 2007. When I run the program, Outlook does not display the Address Book Access Prompt window. Instead it gives an Access Denied exception. I want to make the Address Book Access Prompt window visible as it used to in Outlook 2003.
Run-time exception thrown : System.UnauthorizedAccessException - [Collaboration Data Objects - [E_ACCESSDENIED(80070005)]]
This is the error that I receive. Following is the code I use to import e-mails from the Inbox.
objInbox = CType(CType(mobjSession, MAPI.Session).Inbox, MAPI.Folder)
objMessageCollection = CType(objInbox.Messages, MAPI.Messages)
' Get the first message
objMessage = CType(objMessageCollection.GetFirst, MAPI.Message)
objSender = CType(objMessage.Sender, MAPI.AddressEntry) 'LINE WHERE I RECEIVE THE EXCEPTION.
I did read that the security features are very relaxed if we have an AV and that if MS Outlook 2007 detects the AV, it will not give the security prompt.
But in my case it gives an exception. It does not display the security prompt nor does it let me retrieve the E-mail information.
Please let me know if you have any work around for this. Thanks in advance.
This is the error that I receive. Following is the code I use to import e-mails from the Inbox.
objInbox = CType(CType(mobjSession, MAPI.Session).Inbox, MAPI.Folder)
objMessageCollection = CType(objInbox.Messages, MAPI.Messages)
' Get the first message
objMessage = CType(objMessageCollection.GetFirst, MAPI.Message)
objSender = CType(objMessage.Sender, MAPI.AddressEntry) 'LINE WHERE I RECEIVE THE EXCEPTION.
I did read that the security features are very relaxed if we have an AV and that if MS Outlook 2007 detects the AV, it will not give the security prompt.
But in my case it gives an exception. It does not display the security prompt nor does it let me retrieve the E-mail information.
Please let me know if you have any work around for this. Thanks in advance.

[2005] Import E-mails from OutLook 2007