hello sir,
thanks for your reply.
m extremely sorry for the lack of information.
I have written a Add-in for this purpose in VC++/ATL.
The same code is working fine with the Outlook XP & Outlook 2003.
But the problem is occuring in case of Outlook 2000.
Before doing this i refered following link which also contains your reply :
http://www.gtro.com/delphi/spamfilter_e.php
I am following exactly similar steps which are discussed above(handling
OnUpdate event).
My observation is mail item's(with attachment ) context menu contains more
menu items than a normal mail item's context menu does have.
so may be the case which is discussed in above link is occuring.
Don't know what exactly is happening as m just a begginer in this field.
here's my pseudo code for it:
//Everything is done in OnUpdate()
1. Enumerating CommandBars collection to locate "Context Menu".
2. spCtxtMenuCmdBar->Reset();//before exceutign this code it's crashing.
spCtxtMenuCmdBar->get_Protection(&OldCmdBarProtection);
spCtxtMenuCmdBar->put_Protection(msoBarNoProtectio);
3. Regular code for adding button into it & advise click event for it.
4. restore old protection.
Nikhil.
"Ken Slovak - [MVP - Outlook]" wrote:
> If you are going to hijack other threads at least provide enough information
> for your question to be answered. I have no idea what your code is doing,
> what version of Outlook, whether it's VBA or addin code or in what language,
> or much of anything else other than your code isn't working right.
>
> Are you assuming a mail item and not testing for it before instantiating a
> mail item object?
>
> --
> 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
>
>
> "nikhil" <(E-Mail Removed)> wrote in message
> news:53C4D3D2-DF90-4BFC-B36D-(E-Mail Removed)...
> > Hello,
> >
> > I am doing similar kind of thing that John ericskon is talking about.
> > The only difference is that i am adding menu items in the main context
> > menu.
> > The problem that i am facing is, when i right click on a mail item my menu
> > items
> > are getting inserted & are working fine all the time.But when i right
> > click
> > on a
> > non-mail item or a mail item(with attachment) outlook simply crashes.
> > slovak sir can you please giude me on this.
> >
> > nikhil
>
>