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.
-- 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
"Mohit" <mohitscjain[ at ]gmail.com> wrote in message news:1173876867.754505.325710[ at ]p15g2000hsd.googlegroups.com...
[Quoted Text] >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? >
|