D
David Thielen
Hi;
When the ribbon is updated I have a bunch of different methods that
get called, one for each item in the ribbon. For most of them, their
enabled/disabled is dependent on what is presently selected in the
document.
So I implemented some code where it saves the Start & End of the
Selection Range. Then if I am asked again what is selected, if the
Start/End is the same and it is under 1/2 second since the last query
- just return the previous query.
Doing this is critical because my code, if it is asked what is
selected, needs to go through all fields, ContentControls,
InlineShapes, & Shapes as well as the selected text. The cursor
bounces between hourglass and arrow about 20 times in 2 seconds.
Ok, so all great until... the selected item in the document is a
bitmap and it is changed between InlineShape and Shape (either way).
The Start/End haven't changed, but it's now a different object and the
old object is no longer in the document.
Even worse, the old object is still good and if it is selected, it is
placed back in the document.
So, any suggestions on knowing when the selection has changed?
thanks - dave
david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
When the ribbon is updated I have a bunch of different methods that
get called, one for each item in the ribbon. For most of them, their
enabled/disabled is dependent on what is presently selected in the
document.
So I implemented some code where it saves the Start & End of the
Selection Range. Then if I am asked again what is selected, if the
Start/End is the same and it is under 1/2 second since the last query
- just return the previous query.
Doing this is critical because my code, if it is asked what is
selected, needs to go through all fields, ContentControls,
InlineShapes, & Shapes as well as the selected text. The cursor
bounces between hourglass and arrow about 20 times in 2 seconds.
Ok, so all great until... the selected item in the document is a
bitmap and it is changed between InlineShape and Shape (either way).
The Start/End haven't changed, but it's now a different object and the
old object is no longer in the document.
Even worse, the old object is still good and if it is selected, it is
placed back in the document.
So, any suggestions on knowing when the selection has changed?
thanks - dave
david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm