How can I test to see if a Selection object has been deleted?

S

Scott McPhillips [MVP]

David Thielen said:
I am caching one and so Word can then delete it and I don't know it
has been deleted. When I go to access it, it throws an exception.

How can I test if it's been un-marshalled (or whatever is done to it)?

thanks - dave


I would think that the very idea of caching this object is incompatible with
the definition and purpose of the object. It represents the "current"
selection, and "There can be only one Selection object per document window
pane," both quotes from the Word VB help.
 
D

David Thielen

Hi;

Let me rephrase, I'm caching the Range. But you are right - I now
cache the Start & End value which does make more sense.

thanks - dave


I would think that the very idea of caching this object is incompatible with
the definition and purpose of the object. It represents the "current"
selection, and "There can be only one Selection object per document window
pane," both quotes from the Word VB help.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Top