Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Assinging a macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NWO - 02 Mar 2006 17:40 GMT
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 :)
Helmut Weber - 02 Mar 2006 18:44 GMT
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.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Tony Jollans - 02 Mar 2006 18:59 GMT
Have you tried doing what you know in Excel, in Word?

--
Enjoy,
Tony

> Hello.
>
[quoted text clipped - 5 lines]
>
> Mark :)
Helmut Weber - 02 Mar 2006 19:17 GMT
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.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Tony Jollans - 02 Mar 2006 19:54 GMT
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.

--
Enjoy,
Tony

> Hi Tony,
>
[quoted text clipped - 18 lines]
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
Curt - 21 Jan 2007 15:56 GMT
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
cagreer@att.net

> Hi Tony,
>
[quoted text clipped - 10 lines]
>
> It's high time this should be standardized in all of office.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.