Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Suggestions on employing BackgroundWorker or similar strategy to speed up processing?

$
0
0

I am using Word's WindowSelectionChange event to tell me when the user has modified the content of a specific area of the active document. At this point, the code in my VSTO global add-in performs a series of steps such as checking various ranges and updating content in the document's header. The problem I am seeing is that an hourglass is shown during this processing, and Word 2013 has a definite performance lag when compared against Word 2010. 

Other than the usual things (i.e., optimizing use of Word objects, using Range instead of Selection object whenever possible, suppressing ScreenUpdating, discreet use of DoEvents, etc.), I am looking for ideas on how I can make this lag less obvious. I have heard of the BackGroundWorker class but I do not know much about it... Or, would that possibly lead to problems if called from within a Word add-in's WindowSelectionChange event (any maybe it is not even possible)?

Any tips or suggestions will be greatly appreciated.


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>