We've inherited some code for a VSTO Outlook Add-In that pops up a modal dialog sort of as an acknowledgement to the end user before sending an email.
The dialog is fired on the Application_ItemSend event
Private Sub Application_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles Application.ItemSend
The problem that we're seeing is that when we show the dialog:
objCheckDialog.ShowDialog()
The outgoing email window is minimized, when the dialog pops-up which is not desirable and using .Show() is also not desirable.
During our research we've seen some issues where it was suggested to investigate parent properties of our dialog object, however we don't see any parent properties available which would allow us to maximize the parent:
Another suggestion was to pass the ShowDialog() a reference to the Add-In to specify an owner of the dialog box, IE:
objCheckDialog.ShowDialog(Me)
Since that property is also Nothing, but thought that this might populate Parent:
However, that throws the following exception:
{"Unable to cast object of type 'XYZ.ThisAddIn' to type 'System.Windows.Forms.IWin32Window'."}
Any idea of what we're doing wrong?
Thanks.