Cyrus Major
Posts: 3
Joined: 2011-02-08
|
I am using Add-In Express 2010 for .Net and I added an Outlook Inspector bar and added a button to it that bar.
OnClick of that button i have a code to open windows forms like this
private void adxCommandBarButton2_Click(object sender)
{
TestForm test = new TestForm();
test.Show();
}
The addin registers correctly in Outlook 2003 but when i click the button from New Mail window it opens my windows forms but it just freeze that windows form. I just have a textbox and button on that windows forms and no other code.
This freezing behavior only happens when the button is clicked from Mail item. If I click on the button from New appointment window or anywhere else the windows forms opens perfectly. Can you help? |
|
Eugene Astafiev
Guest
|
|
Cyrus Major
Posts: 3
Joined: 2011-02-08
|
It still does not work. I have sent you an email with sample project yesterday. Can you please look into that? |
|
Eugene Astafiev
Guest
|
Hi Cyrus,
Thank you for providing me with a sample add-in project. I have reproduce the issue you described above. Please see my remarks below:
1. Please use the following line of code instead:
window = OutlookApp.ActiveInspector();
not
window = OutlookApp.ActiveWindow();
2. Do you use Word as an e-mail editor? If so, the inspector window is run from another process (WORD.EXE). The approach, the the sample add-in project illustrates, will not work in that case. Please have a look at http://www.add-in-express.com/files/projects_pub/winformoverwordinoutlook.zip project. It will help you to bridge the gap ;-) |
|
Cyrus Major
Posts: 3
Joined: 2011-02-08
|
Yes i do use Word as the email editor. So i downloaded your new example and it worked for model window. But i dont want a Model form. So as mentioned in your example i used
SetParent(myForm.Handle.ToInt32(), GetForegroundWindow());
But when i tried that it did not open any window. So its not working for non-model window. Can you please help? |
|
Eugene Astafiev
Guest
|
Hi Cyrus,
Please make sure that you use the Show method of the form (not ShowDialog). For example:
SetParent(myForm.Handle.ToInt32(), GetForegroundWindow());
myForm.Show();
Note, I used the Show method without parameters. |
|