Hi all!
It seems that ever since one of the recent Office updates the caption
of WordMail inspectors no longer contains the mail item's subject but
just invariably reads "Microsoft Outlook". It is also no longer in sync
with what's returned by the Inspector.Caption property. I can verify
this behaviour with Outlook v11.8206. The latest build I could find in
our test environments where the caption still contains the subject is
v11.8169. Is there any do***entation about this change somewhere? Which
particular hotfix caused this? Was this intentional (and thus bound to
stay) or was it a mess-up at MS?
More im****tantly: Does anyone have an idea how to solve the following
problem now that the inspector's Caption is no longer a viable means of
identifying a window?
I need to get the window handle of a new mail inspector window so I can
send a couple of window messages to it. This is initiated from the
inspector's Activate event, i.e. when the window is not yet visible -
or, in the case of a WordMail inspector, not even instantiated yet. So
far, I've dealt with this problem like this:
For native inspectors, query interface them for IOleWindow, get their
handle, wait until GetForegroundWindow returns that handle.
For WordMail inspectors, read Inspector.Caption, then wait until a
foreground window with that caption (and the "OpusApp" window class)
turns up and use its handle. Admittedly not as reliable as using the
known handle but in practice has been good enough so far.
How do I now get at the new inspector's handle if I no longer have the
caption to go by? Query interfacing for IOleWindow unfortunately does
not work with WordMail inspectors.
I guess I could enumerate all Word windows at the time of the Activate
event and repeat that at intervals until a new one with an Envelope
commandbar turns up but that seems like an awful hack (well, not that
having to use window messages from a COM addin in the first place isn't
making me feel all filthy already). I'd really prefer some slightly
"cleaner" solution...
Any ideas?
P.S.: My addin is a pure Win32 COM-addin written in Delphi 2007 using
the Add-in Express framework and the Redemption library.
--
Oliver


|