Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4347176
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:16:15+00:00 2026-05-21T12:16:15+00:00

I am trying to create a Word add-in (Word 2007, VS 2008) to get

  • 0

I am trying to create a Word add-in (Word 2007, VS 2008) to get various statistics for long texts. The functions for computing statistics are in a separate class and are not complicated, but are time-consuming. The calculations are started from a custom task pane button in my add-in and presented in a DataGridView control in the same CTP when finished. This works well, except that Word is blocked while the calculations are performed. For long texts this can take time (for example ~ 10 seconds for 800 hundred pages document). I have read some previous threads on this issue and attempted to use BackgroundWorker, but this didn’t help – Word is stil blocked. Here is my current code:

        private void btnAnalyze_Click(object sender, EventArgs e)
    {
        worker.RunWorkerAsync();
    } 

    private void worker_DoWork(object sender, DoWorkEventArgs e)
    {
        e.Result = Tools.CalculateStatistics(
            Globals.ThisAddIn.Application.ActiveDocument.Content.Text,
            statOptions);
    }

    private void worker_RunWorkerCompleted(
        object sender, RunWorkerCompletedEventArgs e)
    {
        gridResults.BeginInvoke(
            new GridDelegate(RefreshGrid),
            e.Result as List<Tools.StatResults>);
    }

    private void RefreshGrid(List<Tools.StatResults> list)
    {
        statList = list;
        gridResults.DataSource = statList;
        gridResults.Refresh();
    }

worker is the BackgroundWorker object, gridResults is the DataGridView control, statList is a generic List that is a data source for the DataGridView. (it is a private member of my add-in usercontrol)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:16:16+00:00Added an answer on May 21, 2026 at 12:16 pm

    I haven’t already tried using a thread in Word. The last article I’ve read about related to Outlook, but I think it’s worth to have a look at the comment of Ken Slovak concerning threads in
    Outlook 2010 64 bit Add-in- Crashing creating another thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to create word 2007 add-in using VS2008, and i need to
I'm trying to create a simple Word add-in. I have created a Word 2010
I'm trying to create a word search game (kind of like Wordament but much
Trying to create a black line in my view to separate text blocks but
Trying to create a new Dedicated Cache Role in Windows Azure but get the
I am trying to create a bad word filter method that I can call
I'm trying to create a method that will add a node to my linked
I am trying to create word documents using Microsoft office interops. The document should
I am trying to create a simple MS Word addin (mostly to explore functionality).
I'm trying to add a Header and Footer to an empty word document. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.