none
How to speed up Word add-in RRS feed

  • Question

  • Our word addin processes some specific tables. It detects our tables one by one and create our xml, then performs the XSLT transformation to generate different outputs.

    we also writes some text, add bookmarks and set headings for all our tables and finally creates the index table for all tables.

    Our problem is that this whole process takes much time for the long document which have more than 200 pages and sometimes ms word is not responded or crashed during processing it.

    We need some techniques to speed up our word addin, so we can process at least 400-500 pages document that have only our tables within minimum time and without responding or crashing word.

    Thanks,

    Anil

    Tuesday, November 26, 2013 11:58 AM

All replies

  • Hi Anil,

    Do you perform the XSLT transformation (to generate different outputs) in another thread?

    It looks line you need to use threads for improving the response time of your add-in. The entry point for such task is the System.Threading namespace. However, be aware that Office host applications is not thread safe: you should process Excel objects in the primary thread.


    Tuesday, November 26, 2013 1:11 PM
  • Hi Anil

    Can you explain how your code is doing the processing, or show us the basic code?

    My first main concern is the way you're creating the xml from the tables. "Walking" tables cell-by-cell is very slow...

    There's also a question in my mind whether it might not be better for you to work with the closed document, leveraging the Open XML file format (Open XML SDK)?


    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, December 7, 2013 12:52 PM
    Moderator
  • Hello Cindy Meister,

    we store some particular cell value in the dictionary(like table.cell(2,2).range.text) and then iterate on dictionary to create xml for that table. This process is repeated for all our tables one by one. During this process we show some GUI errors in table row and add bookmark for each table.

    Our application take more time to create xml file and table of content for our tables in which hyperlink is created to navigate to the particular table by using boomarks.

    Thanks,

    Anil


    • Edited by Anil1234 Thursday, December 12, 2013 7:29 AM test edit
    Thursday, December 12, 2013 5:43 AM
  • Hello Eugene_Astafiev,

    Ok also we go with threading but output generation is not main problem.

    we store some particular cell value in the dictionary(like table.cell(2,2).range.text) and then iterate on dictionary to create xml for that table. This process is repeated for all our tables one by one. During this process we show some GUI errors in table row and add bookmark for each table.

    Our application take more time to create xml file and table of content for our tables in which hyperlink is created to navigate to the particular table by using boomarks.

    Thanks,

    Anil
    • Edited by Anil1234 Thursday, December 12, 2013 7:27 AM edit test
    Thursday, December 12, 2013 5:57 AM
  • measure the performance, either use some professional tool, or put in measurement codes, to identify the performance area.
    Thursday, December 12, 2013 6:16 AM