macro button

J

Jack B

Re Word 97 ----

Years ago I created a macro -- call it BBmacro -- and made a button for it
(put into the Formatting toolbar).

I have accidentally deleted the macro using the Visual Basic editor, so I
created another similar macro using a different name -- call it JBmacro.
How do I make the old button call up JBmacro?

Jack
 
S

Suzanne S. Barnhill

Why not just rename the macro?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jack B

Suzanne --

You're talking to a visual basic Rodney Dangerfield. I tackle something
like this only once in a blue moon, and was lucky to figure out how to
rewrite it without screwing up something else. Seems like a number of
macros are on the same "sheet."

Anyway,
1) I am not sure what to rename the macro. When I move the cursor over the
button, it says "BB macro." However, I know there can't be any spaces, and
I'm not sure that "BBmacro" was actually the name. What name do I need to
change it to?
2) To change the name, do I go back to VB and change the name -- that's it?

Jack


Why not just rename the macro?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
S

Suzanne S. Barnhill

I'm a VBA dunce myself, but I believe what you need to do is open the VBA
Editor (Alt+F11) and look for your macro. If you didn't specify any other
module to save it in, it will be saved in the NewMacros module of
Normal.dot, which is what opens by default when you open the editor.
Whatever appears after Sub is the name of the macro. Just change that name
to whatever is on the button, and with any luck the button will work.

Failing that, in Tools | Customize, select the current macro and create a
button for it. Then right-click on the existing button and Copy Button
Image. Right-click on the new button and Paste Button Image. Then drag the
old button off the toolbar.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jack B

Suzanne,
If you didn't specify any other module to save it in, it will be saved in
the NewMacros module of Normal.dot<

Ahh, I never was sure what that was all about - ok, so that's default.
Well, in trying to put a macro in its own module, I wiped out some other
macros in the past.

I guess what I need to do if want to put a macro in own module is
1) open the VBA Editor (Alt+F11) -- in my case, doing that gives me a blank
situation (no module to edit or create),
2) then go to the menu bar, click Insert and click on Module. But what I
get is a module that the title bar says is "Document1 - Module1 (Code)" and
in the top left drop down is "(General)" and in the top right drop down is
"(Declarations)" -- no quotes around any of that. If I create a macro, the
Declarations changes to the macro name I make. There seems to be no way to
save the macro, except via File/save Doc1.doc, which is the default blank
Word document. Then the macro is apparently associated only with that
document, because the macro shows up in Tools/Macros only when Doc1.doc is
the active document.

If you can explain how to make it part of Normal.dot, that would be
enlightening.

Anyway, for my button situation I did:
Failing that, in Tools | Customize, select the current macro and create a
button for it. Then right-click on the existing button and Copy Button
Image. Right-click on the new button and Paste Button Image. Then drag the
old button off the toolbar.

Thanks,

Jack



I'm a VBA dunce myself, but I believe what you need to do is open the VBA
Editor (Alt+F11) and look for your macro. If you didn't specify any other
module to save it in, it will be saved in the NewMacros module of
Normal.dot, which is what opens by default when you open the editor.
Whatever appears after Sub is the name of the macro. Just change that name
to whatever is on the button, and with any luck the button will work.

Failing that, in Tools | Customize, select the current macro and create a
button for it. Then right-click on the existing button and Copy Button
Image. Right-click on the new button and Paste Button Image. Then drag the
old button off the toolbar.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
S

Suzanne S. Barnhill

If you start with Tools | Macro | Macros, type a name for your macro, and
then click Create, you'll be all set. To change the name of your macro,
though, go to Tools | Macro | Macros, select the existing macro, and choose
Edit. Then change the name of the Sub in the VBA Editor.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

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