Can't find my macros to copy them to the laptop

G

Guest

I have created some macros in VB that work great with the template form I've
created on one computer. When I copy that form to another computer on the
net, the macros are gone. On the original computer it says they are stored
in "All active templates and documents." Is that a place?
 
J

Jay Freedman

I have created some macros in VB that work great with the template form I've
created on one computer. When I copy that form to another computer on the
net, the macros are gone. On the original computer it says they are stored
in "All active templates and documents." Is that a place?

That phrase is, um, inaccurate -- it applies literally only when
you're looking at the list to see what macros exist. If you create a
new macro while that phrase is selected in the Macro dialog, the macro
is saved in the Normal.dot template. To save it initially in some
other template, you'd have to select that specific template by name.

Now that you know where it is, you can use either of two methods to
move it to your form template.

The better one -- for being able to understand what you're doing -- is
to work within the VBA editor. First open the form template or a
document based on it, so that template is available to Word. As
always, Normal.dot will also be available. Then open the VBA editor
and display the Project pane.

In that pane, expand the Normal project. It will have at least one
module, probably named either NewMacros (if you recorded the macros)
or Module1 (if you wrote them directly). Double-click that to see the
code.

Now select and expand the form template's project. If there is no
Modules node in the tree diagram, click Insert > Module (not "Class
Module").

Copy or cut the code of your macros from the Normal.dot module, select
the form template's module, and paste in the code. Save both templates
when exiting Word.

The second method is to use the Organizer (Tools > Macro > Macros >
Organizer). This can be quicker if you know what to expect, but it
only shows you the names of whole modules rather than individual
macros.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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