Uniquely Identifying Word.Document instances

Add-in Express™ Support Service
That's what is more important than anything else

Uniquely Identifying Word.Document instances
 
Dominic Messenger




Posts: 1
Joined: 2008-04-14
I have just started using Add-in Express for .NET but have .NET and COM experience, so understand the overall architecture.

I want to "wrap" each instance of a Word.Document COM interface in our own class so I can track our own modifications in a multi-document environment.

Therefore I need a way of uniquely identifying a document from the Word.Document COM interface, to map the COM to the .NET wrapper.

GetHashCode() (and therefore Equals) return different values each time Activate is called, so this cannot be used as a key. Neither can the COM interface, since this changes every time too.

Is there another ID in the Word.Document that I can use to uniquely identify each document instance (rather than the COM interface instance)?
Posted 14 Apr, 2008 14:03:09 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Hi Dominic.

Please try to use the FullName property of document.
Posted 15 Apr, 2008 07:00:29 Top