A
Alex
Hello,
I have a Word add-in written in C#.
In it, I have a reference to a Word bookmark:
Microsoft.Office.Interop.Word.Bookmark bm = /* ... */;
However, the user may delete the bookmark at any moment and if that happens, an attempt to use the reference generates an "object has been deleted" COM exception.
Is it possible to pre-emptively test the variable to make sure that it points to a valid Word object without throwing an exception?
I have a Word add-in written in C#.
In it, I have a reference to a Word bookmark:
Microsoft.Office.Interop.Word.Bookmark bm = /* ... */;
However, the user may delete the bookmark at any moment and if that happens, an attempt to use the reference generates an "object has been deleted" COM exception.
Is it possible to pre-emptively test the variable to make sure that it points to a valid Word object without throwing an exception?