-----Original Message-----
Adrian,
By "stepping through" we mean run the macro from the editor,
rather than from Word, and run it pressing the F8 key, which
executes one line of code at a time. This usually helps you
pinpoint the exact line that's choking the compiler.
If your code is lengthy and big chunks of it are obviously
problem-free, you can use CTRL+F8 (Run To Cursor) to run
parts of it normally, or F9 (Toggle Breakpoint) to set a
place where the code will always stop and let you start
stepping.
(Of course, if the macro depends on certain things being
present in the active document, make sure such a document,
rather than the the macro-containing template, is the
active file. Also, if your code builds anything *into*
the template (command bars, etc.), it's safest *not* to
edit it when you find the source of the error; rather,
close it without saving, reopen it, then fix it.
--
Mark Tangard <
[email protected]>, Microsoft Word MVP
Please reply only to the newsgroup, not by private mail.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters
.