The obvious question is if that MAPIFolder object is valid when you ask for
the folder name? Do you check that? If it is a valid folder I can't think of
a reason why the name isn't available.
In general with COM addins you should be handling all possible errors. With
managed code you have to do even more exception handling than you would with
unmanaged code, things are less forgiving with managed code. You need to put
try...catch blocks around any code that could fire an exception, and you
need to test for things such as properties like EntryID. In unmanaged code
an item that was never saved will have a null string EntryID, in managed
code the property may not be there. So you'd need to test for
String.IsNullOrEmpty().
You should also not use compound dot operators, which create invisible
variables you can't release, and which make it impossible to see exactly
where any code is failing.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"j" wrote in message
...
Hi all.
I develop vsto addIn 2005, OL 2003, C# 2.0
One of my customer sometime got comException --
System.Runtime.InteropServices.COMException (0xB174010F): The
operation failed.
at Microsoft.Office.Interop.Outlook.MAPIFolder.get_Na me()
In the code we try to get Folder's name.
Why this happen??
How can i recover from this error?? (otlook restart helps, but this is
not solution.)
Thanks in advance.