Handling events for related objects
I would like to use MS Office automation and have event handlers that fire for events triggered by the user. For example, if the user clicks the save button in Word, I want to intercept this event and execute the code in my program.
I don't want to bind to a specific version of Word because I don't know which version my user will be working on, so I create a link to Word using late binding.
The problem is that the AddHandler and Dim WithEvents commands require specific references to an object that is known at design time. With this in mind, how can I define an event handler without early reference to a specific version of the Word library?
I can try to reference an earlier version of Word with the expectation that newer versions of Word will be backward compatible, but that seems kludgey and risky.
Is there a better way without getting too far behind the covers?
a source to share
This is similar to the answer, but ugly. I'm going to read it a few more times.
http://www.codeproject.com/KB/cs/zetalatebindingcomevents.aspx
Are there any better options? I doubt. he.
a source to share