none
Error while executing WebBrowserControlWindow() function RRS feed

  • Question

  • Hi,

    I am working on creating Addin for MS Project 2010 using Visual Studio 2010. I am creating Project Guide and document pane using HTML. I am using Application variable to access object model of the MS Project 2010. I am using function WebBrowserControlWindow to get access to the current webbrowser control being used in the Project guide and for this I am using following code block in ThisAddin.vb :

    Dim RightDoc_1 As mshtml.IHTMLDocument2

    Dim hw As mshtml.HTMLWindow2

    //FOLLOWING LINE IS THROWING AN EXCEPTION

    RightDoc_1 = Application.Windows2.ActiveWindow.WebBrowserControlWindow()

    hw = DirectCast(RightDoc_1.frames.item(1), mshtml.HTMLWindow2)

     

    I have also added reference to Microsoft.Mshtml dll. But while executing the statement Application.Windows2.ActiveWindow.WebBrowserControlWindow(), I am getting following exception :

    Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

    After this, I opened project properties and checked the boolean REGISTER FOR COM INTEROP. I checked it but now it gives error even while I build the solution. Following errors are appearing in the error list when i build the solution :

    1. The assembly "C:\SampleAddin\SampleAddin\bin\Debug\SampleAddin.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'SampleAddin.ThisAddIn, SampleAddin'. Error: Error loading type library/DLL. SampleAddin

    2. The assembly 'Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered for COM Interop. Please register it with regasm.exe /tlb. SampleAddin

    I am stucked at this stage with the function WebBrowserCOntrolWindow(). Any suggestion and help will be appreciated.

    Wednesday, March 30, 2011 6:31 AM

All replies

  • Hi,

    I am working on creating Addin for MS Project 2010 using Visual Studio 2010. I am creating Project Guide and document pane using HTML. I am using Application variable to access object model of the MS Project 2010. I am using function WebBrowserControlWindow to get access to the current webbrowser control being used in the Project guide and for this I am using following code block in ThisAddin.vb :

    Dim RightDoc_1 As mshtml.IHTMLDocument2

    Dim hw As mshtml.HTMLWindow2

    //FOLLOWING LINE IS THROWING AN EXCEPTION

    RightDoc_1 = Application.Windows2.ActiveWindow.WebBrowserControlWindow()

    hw = DirectCast(RightDoc_1.frames.item(1), mshtml.HTMLWindow2)

     

    I have also added reference to Microsoft.Mshtml dll. But while executing the statement Application.Windows2.ActiveWindow.WebBrowserControlWindow(), I am getting following exception :

    Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

    After this, I opened project properties and checked the boolean REGISTER FOR COM INTEROP. I checked it but now it gives error even while I build the solution. Following errors are appearing in the error list when i build the solution :

    1. The assembly "C:\SampleAddin\SampleAddin\bin\Debug\SampleAddin.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'SampleAddin.ThisAddIn, SampleAddin'. Error: Error loading type library/DLL. SampleAddin

    2. The assembly 'Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered for COM Interop. Please register it with regasm.exe /tlb. SampleAddin

    I am stucked at this stage with the function WebBrowserCOntrolWindow(). Any suggestion and help will be appreciated.

    Wednesday, March 30, 2011 6:33 AM
  • Hi,

    I am working on creating Addin for MS Project 2010 using Visual Studio 2010. I am creating Project Guide and document pane using HTML. I am using Application variable to access object model of the MS Project 2010. I am using function WebBrowserControlWindow to get access to the current webbrowser control being used in the Project guide and for this I am using following code block in ThisAddin.vb :

    Dim RightDoc_1 As mshtml.IHTMLDocument2

    Dim hw As mshtml.HTMLWindow2

    //FOLLOWING LINE IS THROWING AN EXCEPTION

    RightDoc_1 = Application.Windows2.ActiveWindow.WebBrowserControlWindow()

    hw = DirectCast(RightDoc_1.frames.item(1), mshtml.HTMLWindow2)

     

    I have also added reference to Microsoft.Mshtml dll. But while executing the statement Application.Windows2.ActiveWindow.WebBrowserControlWindow(), I am getting following exception :

    Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

    After this, I opened project properties and checked the boolean REGISTER FOR COM INTEROP. I checked it but now it gives error even while I build the solution. Following errors are appearing in the error list when i build the solution :

    1. The assembly "C:\SampleAddin\SampleAddin\bin\Debug\SampleAddin.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'SampleAddin.ThisAddIn, SampleAddin'. Error: Error loading type library/DLL. SampleAddin

    2. The assembly 'Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered for COM Interop. Please register it with regasm.exe /tlb. SampleAddin

    I am stucked at this stage with the function WebBrowserCOntrolWindow(). Any suggestion and help will be appreciated.

    Wednesday, March 30, 2011 6:34 AM
  • Hi NBDevelopment,

    Thanks for posting in the MSDN Forum.

    Do you try to use the features of your SampleAddin in your application? The exception message’s mean SampleAddin.dll isn’t a COM component. You’re not able to use it as PIA.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 31, 2011 8:14 AM
    Moderator
  • Hi Tom,

    Thanks for reply.

    Yes, I am agree with you that it says its not a COM component.But how to make it COM component.If i clicks on Register for COM interop in project properties,it doesnt allows me to build the solution.

     

    Thursday, March 31, 2011 10:28 AM
  • Hi NGDevelopment,

    It’s based on my experience that you need create a COM to wrap your business method. And share it between your application and your add-in. this is a blog to show how to create a COM via C# http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net .

    I hope it can help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 1, 2011 3:07 AM
    Moderator
  • Hello Everyone !!!

    I am facing the same issue. Did you find the solution. Please post the solution.


    Friday, January 17, 2014 12:10 PM