Outlook 2003 Word as Editor and .NET Forms

Our company has been working on an Outlook AddIn using VSTO which has a number of issues which we have not been able to resolve yet.
We would appreciate any insight or assistance you can offer.

Our .NET AddIn includes support for using Word as editor in Outlook 2003. On the editor window we add a custom command bar button that launches a .NET form. The problem is that the .NET form does not always appear in front of the inspector when Word is being used as the editor.
I have attempted to use the .NET methods and properties available on the Form (TopLevel, TopMost, BringToFront) to make it appear above the Outlook window but none of them were consistently working.

Is there any way I can ensure the .NET form comes out on top as our users are becoming frustrated with this? Thanks.
private void OnSendAndLogClick(Office.CommandBarButton Ctrl, ref bool CancelDefault)
 // Other code 
 using (FrmRegisterDMSEmail registerscreen = new FrmRegisterDMSEmail(_registerEmail))
  if (registerscreen.ShowDialog() == DialogResult.OK)
 // Other code

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

timetracerAuthor Commented:
I have been able to resolve this issue by getting the handle of the Word Editor window with the FindWindow API call (the class is "OpusApp" and the caption is the caption of the inspector window).

I then wrapped the window handle in a class which implements the IWin32Window interface, and can therefore be passed to ShowDialog.

These steps caused the .NET form to correctly appear in front every time on the development machine.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.