Catch all error handler for Word 2003 / VSTO

R

Rob Stewart

Does anyone know if there is a way to catch all unhandled
exceptions in a Word 2003 managed code solution?

In most normal Windows apps you have a high level method
that calls all other methods (e.g. main() ), so you can
implement an error handler there that will catch any
exceptions that fall out of lower levels. However a VSTO
Word solution doesn't seem to have this high level wrapper
that is present for the duration the solution (i.e. the
Word doc) is running.

Any ideas?

Rob
robst618 _at^ senet _dot^ com _dot^ au
 
P

Peter Hewett

Hi Rob

If you're using VBA then I'm affraid not. Word starts macros (procedures) as
the result of an event. The macro that Word starts is ALWAYS the conceptual
equivalent of Main().

All you can do is instantiate a "top" level handler for the particular
procedure (macro) Word has just started.

HTH + Cheers - Peter
 
Top