问题
I am developing a VSTO application for Outlook client. I am trying have my form open in the part of the Outlook client window which is highlighted in red in the following image:
I think I can't use the form regions because they replace the view for a single item. So basically what I want to do is opening my custom form (windows or web) in the red area when I click my tool's button on the toolbar. Any ideas how this can be done?
回答1:
There are three main ways for displaying your own form there:
You can use the WebViewURL and WebViewOn properties of the Folder class for setting a web view state for the folder. Microsoft Outlook uses the rendering engine of the version Windows Internet Explorer installed on the client computer to display the web page. If Internet Explorer is not installed on the client computer, Outlook will not display the web page.
Create an adjucent Outlook window. See Creating Adjacent Windows In Outlook for more informaiton. Note, you need to have a deep understanding of Windows API to move that way, see SetWindowsHookEx.
Add-in Express provides a layout for the form out of the box. There is no need to invent a wheel in that case.
回答2:
You will need to get down to the HWND level to insert your UI - see https://blogs.msdn.microsoft.com/stephen_griffin/2010/06/01/adjacent-windows-in-outlook/ and https://code.msdn.microsoft.com/OlAdjacentWindows/
来源:https://stackoverflow.com/questions/42352369/replacing-part-of-outlook-clients-window-with-a-custom-form