Wow, I suspect there's just not going to be a solution to this
particular problem, which I rarely say, but in this case you may well
have stumped me and everyone on this list. (Yes, that's a
challenge.) For native object methods I'd recommend wrapping the
native code before the script loads and replacing it with a function
that logs each call to that function to your custom object that
records method usage. IE, however, is built defensively and won't let
you wrap COM object methods, and since attachEvent belongs to
IHTMLElement2 (which is part of the MSHTML and not the JSCRIPT
interface), this won't work. Try it. You'll get a nasty exception.
Listeners registered using attachEvent are maintained behind-the-
scenes, that is, they're kept hidden from the scope of the window
object and its children. So unless you have some way to inspect the
code running on the page for instances of attachEvent and you're able
to trace the element references used back to elements on the page,
which is clearly non-trivial, OR unless you have some way of embedding
the ShDocView component in a C# application and getting at the DOM
that way, you're probably not going to find a pure-JScript solution.
See:
http://msdn2.microsoft.com/en-us/library/aa703974.aspxfor more
info on attachEvent (and most everything else in the labyrinthine
annals of Internet Explorer's COM system).
-David