none
Differences in Word Add-in Functionality: Opening a Document Directly vs. Opening Document from Word RRS feed

  • Question

  • Hi. I'm developing an add-in for Word. I've noticed that unless I open a document from Word, the add-in does not work as intended. That is, if I double-click on a document in a folder to directly open it, certain features of the add-in won't work properly. Anyone know why this is?
    • Edited by dealing16 Wednesday, February 17, 2016 10:33 PM
    Wednesday, February 17, 2016 10:27 PM

Answers

  • ^ It seems like the Application_DocumentOpen callback is not being triggered if I open the document directly. I've fixed the issue by simply moving my code to the ThisAddin_Startup method, but is there any reason why Application_DocumentOpen is not being called?
    Thursday, February 18, 2016 3:34 PM
  • Hi dealing16,

    The reason is that the DocumentOpen event should trigger when the default new document is generated, this occurs before the add-in loads and cannot be trapped.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 19, 2016 2:18 AM
    Moderator

All replies

  • Hi dealing,

    What’re features not work? Please post the related code here.

    For different VSTO add-in, it is loaded in a different application domain, for same VSTO add-in, it uses the same domain. So if you open a document and succeed load the add-in, then open a new document, it won’t create a new domain, the ThisAddin_Startup method won’t trigger again.

    If you don’t open a word document and open it directly, it will load the add-in and create a new domain, then ThisAddin_StartUp will be trigger.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 18, 2016 8:15 AM
    Moderator
  • ^ It seems like the Application_DocumentOpen callback is not being triggered if I open the document directly. I've fixed the issue by simply moving my code to the ThisAddin_Startup method, but is there any reason why Application_DocumentOpen is not being called?
    Thursday, February 18, 2016 3:34 PM
  • Hi dealing16,

    The reason is that the DocumentOpen event should trigger when the default new document is generated, this occurs before the add-in loads and cannot be trapped.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 19, 2016 2:18 AM
    Moderator