none
DocumentOpen event not firing from Sharepoint RRS feed

  • Question

  • Hello,

    I'm writing an application level VSTO add-in for Word 2007. My documents are stored in Sharepoint, and I'm having a problem with the Application.DocumentOpen event not firing. If I run Word, hit open, browse to the Sharepoint location and open the document then the event fires, but if I click on the link on the Sharepoint web page then the event doesn't fire. I've tried choosing to check the document out, open read only and already having it checked out and in none of the cases does my test message box appear.

    Any help would be greatly appreciated.


    Cheers,

    Ollie.

    Thursday, June 16, 2011 11:06 AM

Answers

  • Hi Ollie,

     

    I reproduced your issue on my side, it seems when the document which comes from SharePoint Library will open Word thread as a safe mode. The same thing will be done if you open Word via command line “"C:\Program Files\Microsoft Office\Office14\WINWORD.EXE" /a”. I think it will regard to the SharePoint security Setting.

     

    I think explain why this issue will be occurred is the only thing which I can do for you. If you want to open the documents come from SharePoint library with your add-in you need consult more details at SharePoint Support Forum. http://social.msdn.microsoft.com/forums/en-us/category/sharepoint2010 .

     

    Another work round is open Word and click File->Open set the document’s url of the SharePoint in the Open File dialog. When the document open you add-in will run.

     

    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, June 24, 2011 3:02 AM
    Moderator

All replies

  • Hi Ollie,

     

    Thanks for posting in the MSDN Forum.

     

    Would you please show some screen shots for me for further research?

     

    The add-in will work until Word was launched on your computer due to the add-in only work on host application.

     

    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.

    Monday, June 20, 2011 10:16 AM
    Moderator
  • Hello Tom,

    Thanks for replying. What screenshots would be helpful?

    Ollie.

    Monday, June 20, 2011 4:44 PM
  • Hi Ollie,

     

    <<browse to the Sharepoint location and open the document then the event fires>> Do you mean open the document like that?

     

    If it is, the add-in will not work because of this is a Web application, its document is a html script and no Word process is launched to handle it. When you down load the document, a *.docx file will exist on your side Word process will be launched to handler it when you open it.

     

    If I have misunderstood anything, please feel free to let me know. And I think a screenshots will be easier to explain the issue you faced.

     

    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.


    Tuesday, June 21, 2011 2:34 AM
    Moderator
  • Hello,

    The Sharepoint site is set to open files in the client application so it's opening in the Word application. If I click the link in Sharepoint a pop-up appears asking me if I want to open read only or check it out (using local drafts folder or not). Whichever option I use my code in the DocumentOpen event never triggers (I put in a message box to test it). If I then close the document and re-open it using the Recent Documents list in the office menu then the message box appears.

    Ollie.

    Thursday, June 23, 2011 2:01 PM
  • Hi Ollie,

     

    I reproduced your issue on my side, it seems when the document which comes from SharePoint Library will open Word thread as a safe mode. The same thing will be done if you open Word via command line “"C:\Program Files\Microsoft Office\Office14\WINWORD.EXE" /a”. I think it will regard to the SharePoint security Setting.

     

    I think explain why this issue will be occurred is the only thing which I can do for you. If you want to open the documents come from SharePoint library with your add-in you need consult more details at SharePoint Support Forum. http://social.msdn.microsoft.com/forums/en-us/category/sharepoint2010 .

     

    Another work round is open Word and click File->Open set the document’s url of the SharePoint in the Open File dialog. When the document open you add-in will run.

     

    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, June 24, 2011 3:02 AM
    Moderator
  • I was facing the same problem.

    And i can recommend next workaround.

    If we are open document from sharepoint library looks like ThisAddin_startup event fired after DocumentOpen event. And in this case we already have ActiveDocument object in ThisAddin_Startup event code. You can manage your code by veryfing ActiveDocument object


    ruslanin


    Thursday, October 18, 2012 11:14 AM