Before using something like this:
Debug.WriteLine(folder.Name);
You should use code something like this:
if (folder != null)
{
Debug.WriteLine(folder.Name);
}
The same thing applies to any other object such as a CommandBar.
--
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
...
snip
Thanks for replay,
can please explain what you meant by saying :
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.
How should i check if this object valid??? some sample will help.
Also, some time i got comException when trying to access the toolbar:
"Microsoft.Office.Interop.Outlook.ExplorerClass.ge t_CommandBars"
what can i do on the subject.
Thanks.