none
How to load a Word Addin via code when it has LoadBehavior of 9 RRS feed

  • Question

  • Hi, I have a Word 2007 addin (VS 2008 / .NET framework 3.5 / VB.NET) that has a ribbon element, and which is successfully installed with a LoadBehavior of 16 which after first launch successfully changes to a 9.  On second and subsequent launches, the UI loads properly and the rest of the addin does not load.  Perfect.  Works.

    However, I have about 5 macros in a VBA global template that run COM visible code from within that addin when the user types a keyboard shortcut.  When the addin is loaded (after a UI button has been clicked), these keyboard shortcuts work just fine, but, of course, they don't if the addin is not yet loaded.  The connect state of the addin is set at True even though the addin is not actually loaded while its UI is loaded.

    Is there a way that VBA global template can load the addin via the object model?  Or is there a way I can load the addin from another addin of mine (I'd make one additional COM visible sub in my addin that is always loaded that would load the addin that is not loaded)

    Thanks.  --Elena

    Wednesday, June 8, 2011 5:21 PM

Answers

  • I figured it out.  Even if the connect property is True, explicitly set the connect property to True and the entire addin will get loaded.  Works fine.

    Thanks, --Elena

    • Marked as answer by ebaralt Wednesday, June 8, 2011 6:34 PM
    Wednesday, June 8, 2011 6:33 PM

All replies

  • I figured it out.  Even if the connect property is True, explicitly set the connect property to True and the entire addin will get loaded.  Works fine.

    Thanks, --Elena

    • Marked as answer by ebaralt Wednesday, June 8, 2011 6:34 PM
    Wednesday, June 8, 2011 6:33 PM
  • Hi Ebaralt,

    Glad to hear that you have resolved your problem and thank you for sharing your solution with us.

    Best Regards,


    Bruce Song [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, June 9, 2011 10:22 AM