I really don't understand why you're using late binding. You can subscribe
to the events such as Activate using early binding and that works on all
versions. I have no experience with how you're doing things so I can't
really help. I use early binding on the various events and never have
version problems with Activate.
When using early binding you reference the earliest tlb you want to use and
that just works with later versions. It's not so cut and dried with managed
code, there the signatures of things have changed and unless you use the
Outlook 2003 PIA's that support both that version and Outlook 2007 you need
separate addins for earlier versions.
I never use IDispatch to handle events, so there I can't help you.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"bstrum" wrote in message
...
Sorry, "dispid's" are the dispatch ids that are exposed via IDispatch. I
was
able to hack it by trying various values:
0xf001= Activated
0xf006 = Deactivated
0xf008 = Closed
I am making some progress on what should really be a trivial task:
creating
controls on a toolbar. I am still encountering problems and of course
they
vary from office version. Any assistance / insight on this is greatly
appreciated.
Note: All of the problems are occuring within the Inspector-Activated
event. Also, all my code uses late binding.
In Office XP, I am not able to access Inspector.CommandBars. I get an
exception, "Exception has been thrown by the target of an invocation.".
In Office 2003, I am unable to set the Picture property of a newly created
CommandBarControl.
MO.CommandBarControls ctls = the controls of a newly created command
bar
MO.CommandBarControl ctl = ctls["Options"];
System.Drawing.Image img = CommonImages.logo;
ctl.Picture = StdOleUtils.GettIPictureDispFromPicture(img); // throws
exception
In Office 2007, the above code throws an exception on the first activate
event but not afterwards.
Benjamin Strum
ThinkTron Corporation