none
WebBrowser Component not getting loaded in CustomTaskPanes(Microsoft.Office.Tools.CustomTaskPane). RRS feed

  • Question

  • Hi,

    I am trying to load a WebBrowser Component inside a CustomTaskPane and add it to ThisAddin.CustomTaskPanes collection.

    This is working properly in most of the systems. But some users with Windows 10 pro, .Net framework 1.7 and Office 2016, having problem in this.

    Webbrowser is not getting loaded. They are not getting any exception also. When we just open outlook every thing was fine in log. All the lines of code is getting executed, but unable to see the WebBrowser.

    But when we manually move the addin to in-active state (through file->option -> Addin->Com addin->) and make it again active, this time webbrowser is loaded.

    Following is my code, and am using this in ThisAddIn_Startup method of an Outlook addin.

    BrowserPanelUserControl BrowserPanelUC = new BrowserPanelUserControl();
    CustomTaskPane myCustomTaskPane = thisAddin.CustomTaskPanes.Add(BrowserPanelUC, "Zoho CRM");
    myCustomTaskPane.Visible = true;
    myCustomTaskPane.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight;
    myCustomTaskPane.DockPositionRestrict = Microsoft.Office.Core.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
    BrowserPanelUC.Visible = true;
    BrowserPanelUC.webBrowser1.Visible = true;

    BrowserPanelUserControl is a User control, which will have webBrowser1(Public) control alone in it.

    Note:

    1. This behavior happens in some machines allow.

    2. I try to load the same user control in a from, it was working fine.

    3. I tried removing webbrowser from the usercontrol, add adding some other control like button, textbox , etc., Even that works fine.

    Anyone please help with an answer.

    Thanks and Regards

    Renuka

    Thursday, November 29, 2018 12:33 PM