Disable outlook email editor

104 Views Asked by At

I am working on an Outllok adding built with Add-in Express. I am trying to show a modal progress dialog which blocks only the current mail composer/editor window, so that user can still use Outlook while this dialog is shown, but he should not be able to edit the current email. I tried using

dialog.ShowDialog(new WindowWrapper(ADXAddinModule.CurrentInstance.GetOutlookWindowHandle(mail.GetInspector)));

but it blocks whole Outlook. WindowWrapper is just a simple class implementing System.Windows.Forms.IWin32Window. Is there a way to achieve that behavior?

1

There are 1 best solutions below

2
On

There is no built-in mechanisms for that. A dialog window should be closed before coming back to other windows because Outlook windows are not standalone applications, they all represent a single application - MDI.

As a workaround you can use the Show method of the Form class instead. In that case you will be able to move focus to any window in Outlook. To block only the current mail composer/editor window (so-called inspector) you can handle the Activate event of the Inspector class which is fired when an inspector becomes the active window, either as a result of user action or through program code. So, in the event handle you can bring the windows form to front for preventing any changes in the UI.