Displaying popup when composing a mail item.

M

Mohit

I am creating Outlook AddIn using C#, VSTO 2005 SE and outlook 2003.

I have added two buttons on toolbar in the inspector window which is
opened after the user had pressed New button to compose a new mail.
Here while composing the mail editor type is Word Mail.

When user clicks my custom button of my toolbar while composing the
new mail I wrote the code for displaying a Custom Form. But when I run
this only my Form's border appears not the controls contained in the
form. And moreover Application Hangs!!! Nothing seems to happen.

Same custom form works correctly when a mail item is opened to read
and button is clicked. But it is not working while writing/composing a
new mail item.

I am not getting why it is occuring and how can I display my popup
correctly?
Are there some other approaches to accomplish this?
 
K

Ken Slovak - [MVP - Outlook]

The form is being displayed modally behind your WordMail window. That makes
the app and Outlook appear to hang. That's my guess.

WordMail is a subclassed instance of Word. That causes all sorts of problems
with window z-orders and what's the parent of a modal form. In this case
it's the Outlook primary Explorer, which is why the window appears behind
the WordMail window, which is WM_TOPMOST.

You can try using a complicated set of Win32 API calls to set the foreground
window, that's about it. The only other way is to show the Explorer window
and then show yours, then when it's closed show the WordMail window again.
That's messy looking though.
 

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