Hi
As far as Outlook 12 everyone expects that MS will continue its path towards
managed code. Obviously it's way too early to know what Office 12 will do or
if it will drop support for unmanaged code
I wished they would. .NET is really neat, it's interoperability that gives
most people headaches. I was working on a C# only project for a while and
that was truly sweet. But I'm getting off subject here..
A properly constructed Inspector wrapper should enable handling all the
things you've mentioned. The big problem is handling Next/Previous in
versions or builds that don't fire NewInspector. You get multiple
Inspector.Activate and Deactivate events in different orders depending on
whether Next or Previous was pressed and if the item had been opened in that
Inspector previously. Handling the Item.Open and Close events has always
worked for me in those cases.
Is there any consistent order in the way those are fired? I've done a lot of
testing, and basically as long as I have one contact open and do the
previous/next thing, and have a messagebox tell me about what is happening,
the events are fired in the following order:
Inspectors.NewInspector
ContactItem.Open
ContactItem.Close
That's already somewhat problematic because logically the close should
become before anything else. But, if I remove those messageboxes and write
debug code (using the Debug object), then not all those events are fired all
the time anymore, and that's where my problem began. Now suddenly, I once
again received two button click events, one for the old item and one for the
new (and it wasn't as if a click had been list.. clicking the new item
effecitvely triggered two clicks in the new Inspector). I catched that by
running a sanity check in the click handler (using the button tags.. having
them unique does come in very handy there), but it bothers me a bit that I
do get more events than I should, and sometimes less than I expect. Also,
when I press next and there's no next contact, the contact window closes,
and while I do get a contact.close, the inspector isn't closed. This only
happens when I close Outlook (upon which I get all the inspector.close
events that have not been registered before).
I've also addes some sanity checking in the ContactItem.Open code, checking
if my current ContactItem is the one that belongs to the Inspector wrapper,
and if not, updating it so I don't see many more options to deal with all
this stuff. I think I've got it the way I need it to work, but I'd like to
think it should be possible to have these events in a predictable manner all
the time.
Regards
Stephan