Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am writing an application that uses Microsoft Outlook libraries to access some folders. I have a problem where I can open up the namespace and get the default Inbox folder but whenever I try to access the underlying folders I get the error:
[System.Runtime.InteropServices.COMException]	{"Interface not registered (Exception from HRESULT: 0x80040155)"}	

I am able to get unreadItemcounts and view the properties of the Inbox. The code that I am using is:
C#
appOutlook = new Outlook.Application();                    
nsOlApp = appOutlook.GetNamespace("MAPI");
nsOlApp.Logon(Type.Missing,Type.Missing, true, true);
// nsOlApp.Logon(Type.Missing, Type.Missing, Type.Missing, Type.Missing);
oFolder = nsOlApp.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
foreach (Outlook.MAPIFolder fldr in oFolder.Folders)
{
    MessageBox.Show(fldr.Name.ToString());
} 

Has anyone else had this problem?

I have registered ole32.dll successfully and must use Outlook libraries as I need to access sub-folders int he inbox for a particular application.

thanks
Posted
Updated 17-Jun-13 16:23pm
v3
Comments
Narelle Gatti 17-Jun-13 17:34pm    
Sorry - Amit. I missed saying that I require Outlook as I am linking into Microsoft Outlook to write a specific application that looks at sub-folders within outlook.

Following are the checkpoints for this error:
  1. You should be using the Interop.excel.Dll. the Excel.Exe library will give this error. Errors starting with 0x8 are permission errors or invalid pointer to memory.
  2. Go to --> Start --> run --> Enter REGSVR32 OLE32.DLL --> OK
    This will show the message : ole32.dll succeeded




--Amit
 
Share this answer
 
v2
Hi Amit

Thanks for your response. I have registered ole32.dll successfully and still have the problem. I do think that there is an invalid memory problem but it could be to do with a missing like that instantiates something that I have missed. Any other ideas are really welcome.
 
Share this answer
 
Comments
Richard C Bishop 17-Jun-13 17:35pm    
Do you realize the flaw in the logic of posting a question/comment as a solution to your own question?
Narelle Gatti 17-Jun-13 22:24pm    
Sorry first time user.
Richard C Bishop 18-Jun-13 10:13am    
It's all good, I just wanted you to think about it and be more mindful of what you are doing rather than ridicule you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900