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 / September 2006

Tip: Looking for answers? Try searching our database.

Button on page to run macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Francis Hookham - 08 Sep 2006 10:07 GMT
Having transferred a module containing a series of subroutines from 'Normal'
to a Word document I want others to be able to run two of the subs from that
document since they will not understand how to transfer the module to their
Normal file.

Question

How can I assign a macro to an object on the page which the user can click
to run the macro? In XL that's simple but in Word I cannot see how to do it.

Francis Hookham
Jezebel - 08 Sep 2006 11:17 GMT
A macrobutton field is the obvious answer.

But separately, unless this code needs to be run only once, putting the
macros in documents (as opposed to templates or add-ins, where they belong)
is likely to spell disaster. The maintenance challenge is insurmountable.

> Having transferred a module containing a series of subroutines from
> 'Normal' to a Word document I want others to be able to run two of the
[quoted text clipped - 8 lines]
>
> Francis Hookham
Francis Hookham - 08 Sep 2006 22:45 GMT
I'm not getting anywhere - I see the Insert > Field > Document Automation >
MacroButton and Options and choosing the macro and adding to the field which
produces a field on the Template but that's as far as I get - it does not
click - can you point me to a website where I shall find more info.

The macro pastes in as text part of a calendar copied from my club's website
and formats the text in a particular way - I can run the macro from a button
on my toolbar but I wanted to send a Word document (or a template if that is
the way to do it) which someone else, who does not have ther knowledge to
put the macro into his Normal, could use. I thought a document which held
the macro on a button could be the answer.

Any suggestions apart from 'give up' or 'use XL instead'?

>A macrobutton field is the obvious answer.
>
[quoted text clipped - 15 lines]
>>
>> Francis Hookham
Jezebel - 08 Sep 2006 23:34 GMT
> I'm not getting anywhere - I see the Insert > Field > Document Automation
>  > MacroButton and Options and choosing the macro and adding to the field
> which produces a field on the Template but that's as far as I get - it
> does not click - can you point me to a website where I shall find more
> info.

You don't need a website: Word's Help explains the fields.

Press Alt-F9 to display field codes. You should have a field that looks
something like

{ MACROBUTTON MyMacro DoubleClick }

where 'MyMacro' is the name of your macro and 'DoubleClick' is whatever text
you actually want to see in the document. You'll probably want to format
this distinctively. Press Alt-F9 to hide field codes, then double-click.

Rate this thread:






 
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.