none
Word embed Word documents - Save and Close hangs the process RRS feed

  • Question

  • Hello exports, 

    I am embedding Word documents into Word documents and displaying that as icon. I am running my VSTO addin which on Save and Close eventhandler, takes the documents content as Blob and saves it to the database. In the above mentioned case, Word does not help much and as soon as it tries to save data to DB after that Application hangs. The only way to come out of it is "Task-killer". 

    The code I have written on Save and close is also very simple and nothing very time consuming. 

    The same code works if I wait for almost 10-15 mins and let the Close handler run for the document which I embedded from the file system. (This makes me nervous as only through Debugging I know that it takes this long !!! My understanding was that it should be immidietly after the document is embedded..But my sample code without Addin also takes the same long time)

    I am using VSTO 3.0 with Office 2010 and visual studio 2008. 

     

    Thanks 

    Mukta  


    M Sharma, Deloitte, USA
    Monday, September 19, 2011 3:01 PM

Answers

  • This has been proved out as an exiting issue with VSTO 3.0. This can be reproduced with a simplest code. The issue happens when save happens immediately after embedding. If you open the embedded object, close it and then try the save operation, it works fine. 

    Most likely, it is a threading issue and as per microsoft, has been fixed into VSTO 4.0.


    M Sharma, Deloitte, USA

    • Marked as answer by M Sharma Friday, April 6, 2012 9:05 PM
    Friday, April 6, 2012 9:05 PM

All replies

  • Hi Mukta,

     

    Thanks for posting in the MSDN Forum.

     

    Would you please tell me additional details about your issue:

     

    1.         <<In the above mentioned case, Word does not help much and as soon as it tries to save data to DB after that Application hangs.>>

    Do you mean that Word application crash when you try to save the data to DB? And what type of DB you used? Microsoft Sql Server, MySql, Orcal or others?

    2.         <<This makes me nervous as only through Debugging I know that takes this long!!!>>

    Would you please show me the steps to reproduce this situation? In my opinion, we need to exclude the issue based on communication with DB at first. I don’t how you handle such case on your side. It will help me to research your issue if you are able to explain it. And it will make more sense if you can reproduce your issue via a simple project and show it for us.

     

    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.

    Wednesday, September 21, 2011 2:32 AM
    Moderator
  • This has been proved out as an exiting issue with VSTO 3.0. This can be reproduced with a simplest code. The issue happens when save happens immediately after embedding. If you open the embedded object, close it and then try the save operation, it works fine. 

    Most likely, it is a threading issue and as per microsoft, has been fixed into VSTO 4.0.


    M Sharma, Deloitte, USA

    • Marked as answer by M Sharma Friday, April 6, 2012 9:05 PM
    Friday, April 6, 2012 9:05 PM