Recording macros in Word 2007

W

WordsmithDan

I have begun using Word 2007, usually in compatibility mode. I find that when
I record a macro and assign to a keystroke combination, it only works in some
documents. Many of my macros are simply "assign a style" macro or something
equally simple just because I don't like to go to the mouse for repetitive
actions. Often, I get the "debug-cancel" message. When I recorded macros in
2003, they usually worked across all documents based on templates I had
created.

When I re-record a macro that is not working in the present document, it
asks if I want to replace the existing one with the same name. It clearly
knows the macro is there. Why won't it run in documents? Is there a
specification I can make when I record a macro so that it will be universal?

Thanks in advance.
 
J

Jezebel

If you're getting the debug-cancel message, it means the macro is actually
running, but failing (as opposed to not running at all). The usual cause,
with macros created by recording, is that the macro is making assumptions
about the context in which it is called -- eg, the macro fails if the
selection is (or is not) in a table, or you are in Print view, etc.

Next time you get the debug-cancel message, click Debug and look at the line
that threw the error.
 
W

WordsmithDan

Thanks. I'll try that.

Jezebel said:
If you're getting the debug-cancel message, it means the macro is actually
running, but failing (as opposed to not running at all). The usual cause,
with macros created by recording, is that the macro is making assumptions
about the context in which it is called -- eg, the macro fails if the
selection is (or is not) in a table, or you are in Print view, etc.

Next time you get the debug-cancel message, click Debug and look at the line
that threw the error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top