Winform over Wordeditor

S

Steffen Grellmann

Hi newsgroup,

I'm trying to develop an AddIn for Outlook 2003 (VSTO 2005 SE). Adding
a commandbar to a new Inspector window is working.

Is there anything special when opening Windows forms over Word as
editor? Some forms appear multiple times after dragging them by the
mouse, others not even open.

I do not know this behaviour when opening Windows forms in Word, only
in Outlook with Word as editor.

My own researches gave me the conclusion that this could have to do
with the COM-Threadingmodel, so I added <STAThread()> _ at the entry
point, with no success.

Any help would be appreciated.

Kind regards,

Steffen
 
K

Ken Slovak - [MVP - Outlook]

WordMail is a mess, because it's really msword.exe subclassed by Outlook.
That leads to a situation where Word is partly running on its own and partly
as a process under Outlook. That makes for problems if you want to correctly
set modality on a form and have it show over the WordMail window and still
be modal to Outlook, and just with trying to get a form to be where you want
it in the correct z-order.

The only solutions I've ever found require lots of Win32 API calls to set
the z-order of the form and make it a child window of the WordMail window
and then to call SetWindowPos with an argument of WM_TOPMOST. The WordMail
window you need to parent to the form window is an instance of "OpusApp"
with the caption of your WordMail window, gotten by calling FindWindow with
that class and caption and using that hWnd as the parent window of the form
window.
 
S

Steffen Grellmann

Hi Ken,

thank you very much for replying. I thought the reason would be
something like this. With the background of all these
"Wordeditor-issues" I guess it would be more easier for me to apply my
AddIn only for Outlook 2007.

Kind regards,

Steffen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top