Hi,
we are trying to display a local file, which is a html markup, in Outlook. We have a Custom Message Region that contains Web Browser. The control of Web Browser was designed via Outlook Designer and then imported to our code in Visual Studio.
Then we have code dealing with the browser:
Most important parts of code:
1.Definition and initialization od browser:
partial class MyMessageRegion
: Microsoft.Office.Tools.Outlook.ImportedFormRegionBase
{
private System.Object messageWebBrowser;
protected override void InitializeControls()
{
this.messageWebBrowser =
(System.Object)GetFormRegionControl("MessageWebBrowser");
}
2.Then loading file into the browser looks as follows:
((dynamic)messageWebBrowser).Navigate(path);
where "path" is a path to local file. It could be "C:\Data\xyz.htm" (please notice htm extension)
Definition of problem:
In general it works ok. The browser renders contents of the file in itself, therefore the html is displayd in Outlook to our user.
However sometimes (it is important to note that this popup is being shown nondeterministically) Outlook shows download file dialog, asking do you want to save this file instead of rendering it. This does not always happen and there seems to be no pattern. Do you know how to solve this problem (make the control always render the content of the file instead of asking to download it)?