View Single Post
  #5  
Old July 28th 09, 03:57 PM posted to microsoft.public.outlook.program_addins
j
external usenet poster
 
Posts: 109
Default The operation failed.

On Jul 28, 5:32*pm, "Ken Slovak - [MVP - Outlook]"
wrote:
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.


Thank you,

I got it, now my question is what should i do if i get null in
COMMANDBARS??
by the way i'm moreo then sure, that these objects not NULL, and still
they ends up with ComExcpetion.

What do you say??
Ads