none
using threads in Word VSTO Solution RRS feed

  • Question

  • Hello developers, I am writing a Word-AddIn in VB.NET. The application is to gather registration information from our SQL database and produce a series of reports; registration confirmation, assistance, etc. On a regular day there might be around 50-150+ registrants prior to the event and I have created a Word Template to produce a confirmation report. The process works great but user can actually see the work being done and cannot use word until job is completed.

    I want to do it on the background using a background worker but cannot make go. Anyone has a sample? need to open a new instance or Word, open up the template, connect to database-query data and produce report, once its done make instance visible. I had it working on Word 2007 but does not work on 2010.

    S.O.S.

    Thank you in advance and God bless..

    Wednesday, August 28, 2013 3:58 PM

Answers

  • See http://msdn.microsoft.com/en-us/library/8sesy69e(v=vs.100).aspx.

    In general it's not a good idea to use Office object models from background threads. In fact, with Outlook it's explicitly unsupported and for Outlook 2013 is prohibited.


    Ken Slovak MVP - Outlook

    Friday, August 30, 2013 4:59 PM
  • Hello Sophia,

    Thank you for the reply and I am sorry for the delay in answering. I had the application running on threads in 2007 and it failed when migrating into 2010. When it was working on 2007 we had some issues with the background thing; for instance, a user would close Word suddenly and application then it would delay-failed.

    So I have decided that is really not a very big deal; so what if they have to wait? Besides that I just learned that they are retiring the application :( and outsourcing the event. You win some you lose some.

    Thank you!


    Gustavo Miller

    Tuesday, September 17, 2013 11:35 AM

All replies

  • Hi Gustavo.miller-mhs,

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated. We will let you know if any progress is made.

    Sorry for any inconvenience.


    Sophia Gou <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED> MSDN Community Support Please remember to "Mark as Answer" the responses that resolved your issue.

    Friday, August 30, 2013 5:47 AM
  • See http://msdn.microsoft.com/en-us/library/8sesy69e(v=vs.100).aspx.

    In general it's not a good idea to use Office object models from background threads. In fact, with Outlook it's explicitly unsupported and for Outlook 2013 is prohibited.


    Ken Slovak MVP - Outlook

    Friday, August 30, 2013 4:59 PM
  • Hello Sophia,

    Thank you for the reply and I am sorry for the delay in answering. I had the application running on threads in 2007 and it failed when migrating into 2010. When it was working on 2007 we had some issues with the background thing; for instance, a user would close Word suddenly and application then it would delay-failed.

    So I have decided that is really not a very big deal; so what if they have to wait? Besides that I just learned that they are retiring the application :( and outsourcing the event. You win some you lose some.

    Thank you!


    Gustavo Miller

    Tuesday, September 17, 2013 11:35 AM