Assinging a macro

N

NWO

Hello.

I know how to assing a macro in Excel, but how do you accomplish the same
task in Word, without a bunch of programming? The situation is that I have a
macro with about 5 subs (which I didn't write). How do I simply put this
macro behind a button so that all the end user has to do is click on the
button and the macro will run?

Mark :)
 
H

Helmut Weber

Hi Mark,
The situation is that I have a macro with about 5 subs.
How do I simply put this macro behind a button

as far as I know, in WordVBA a macro, a sub,
cannot include another sub,
as opposed to other programming languages I came across.

You may have a sub call other subs, like:

Sub toplevel
call secondlevel1
call secondlevel2
end sub

To create a button which calls the toplevel macro:

Tools, customize, commands, macros.
Put the cursor in the right listbox on the macro in question,
and drag it into the toolbar of your choice.

Right click on the so inserted button,
and see, how can change it's face etc.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
H

Helmut Weber

Hi Tony,

in Excel, after navigating to
Tools, customize, commands, macros,
things get different from Word.

There are two options:
Custom Menu item
Custom button

You first insert either a menu item or a button
and assign the macro afterwards.

It's high time this should be standardized in all of office.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
T

Tony Jollans

Just the other day I was looking for that smiley face - I knew it was in the
dialog somewhere but could I find it? Now I know why - thank you, Helmut.

Yes, consistency would be nice, wouldn't it? You would think they could
manage it for Office objects.at least.
 
C

Curt

Does word treat buttons same as excel or only active x controls available?
In excel you pull button off of forms bar not tool control. Tool is activex
controls in excel. Not familiar with word macros but willing to learn.
Thank You
(e-mail address removed)
 

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