Copying macros

B

Bruce

Not sure this is the right place for this question, but
there is no macros page, and this is only indirectly about
VBA. I have some simple macros that I have constructed
to, for instance, set a paragraph border. There are
available in Normal.dot and documents based on Normal.dot,
but I can not always use the macros with other templates.
When I try to copy the macro from Normal.dot (using
Organizer) my only choice is New Macros. None of the
actual macros are listed, and copying New Macros
accomplishes nothing that I can see. However, when I
attempt to recreate the macro, I am told that the keyboard
shortcut I plan to use is already in use by the macro that
would do what I am trying to do, if I could only run it
from the shortcut. However, I can run it by going to
Tools > Macros > Run. I have Word 2000 and Windows XP,
and keyboard shortcuts work quite poorly in general
compared to other versions of Word (for instance, I can
not start an Excel file from a keyboard shortcut unless
Excel is closed). Is this a bug, or is there some arcane
branch of knowledge or special terminology or something
that I am missing? Help files are, as usual, little help,
saying only that I can copy macros by following a
procedure that, as it turns out, does not work. Thanks in
advance for any ideas that might help.
 
M

Margaret Aldis

Hi Bruce

As far as copying macros with the Organizer is concerned, this copies whole
'modules', not the individually named macros. By default, when you record a
macro and save it in Normal.dot it is saved in the NewMacros module. If you
open the Visual Basic editor you'll be able to see this quite clearly.

So if you want to copy the macro code to another template using the
Organizer, you can copy the NewMacros module, if there isn't one already in
the target template. Otherwise, you can go into the Visual Basic editor and
copy and paste the code itself.

There's some more information in
http://www.mvps.org/word/FAQs/MacrosVBA/DistributeMacros.htm.

However, I don't think this is at the heart of your keyboard shortcut
problem. If the macros are in Normal.dot, then they will always be
accessible anyway (the fact that you can Run the macro confirms that). But
what I suspect is happening is that the keyboard shortcut definitions in the
attached template are overriding the definitions stored in Normal - they are
perfoming something else, or maybe even a null assignment will override in
Word 2000. I would try reassigning the shortcut in the other template, using
Tools > Customize.
 

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