A
AP
Suppose I create a Document by executing:
Word.Document wd = wa.Documents.Open(ref newDocPathObject, ref missing, ref
missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref
missing, ref missing, ref isVisible);
then I keep a handle to this document in a hashtable:
myEditDocuments.Add(wd,"Document A");
and add an event listener:
wa.DocumentBeforeClose += new
ApplicationEvents2_DocumentBeforeCloseEventHandler(wa_DocumentBeforeClose);
now in my DocumentBeforeClose event handler, a Document variable Doc is
passed in. I wanted to retrieve the object from the hashtable using this Doc
variable, but it appears that the reference is different. I imagine this is
the case because the Document object is being marshaled by the COM interface
(?). Anyway is there another variable within Document that is unique to that
document that I could use as my hashtable key? Fullname will not work
because the user can save the file as something different.
Thanks,
Adam
Word.Document wd = wa.Documents.Open(ref newDocPathObject, ref missing, ref
missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref
missing, ref missing, ref isVisible);
then I keep a handle to this document in a hashtable:
myEditDocuments.Add(wd,"Document A");
and add an event listener:
wa.DocumentBeforeClose += new
ApplicationEvents2_DocumentBeforeCloseEventHandler(wa_DocumentBeforeClose);
now in my DocumentBeforeClose event handler, a Document variable Doc is
passed in. I wanted to retrieve the object from the hashtable using this Doc
variable, but it appears that the reference is different. I imagine this is
the case because the Document object is being marshaled by the COM interface
(?). Anyway is there another variable within Document that is unique to that
document that I could use as my hashtable key? Fullname will not work
because the user can save the file as something different.
Thanks,
Adam