#1
|
|||
|
|||
How do I trigger a macro from a document?
In Excel I can simply insert a shape and have it trigger a macro when the shape is clicked. Tried that in Word and I thought I was going blind as I found no such option to attach a macro to a shape, at least not in a template. Is there another means that is used by normal convention? |
#2
|
||||
|
||||
You could put the Shape into a Rich Text content control and use a Content_Control onEntry to trigger the macro or you could use use Word's Selection_Change event. See:
https://msdn.microsoft.com/en-us/lib...or=-2147217396 http://word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Once again, rescuing me - very much appreciated!
Got to wonder why they don't allow tying macros to shapes with Word but they do in Excel... |
#4
|
||||
|
||||
You can also insert a macrobutton field to run a macro on double click eg
{Macrobutton MyMacro "Double click to run the MyMacro macro"}
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
||||
|
||||
Hi Andrew,
The problem with that is that is that it doesn't work with Shapes - only with InlineShapes - and, if you use, say an Oval autoshape as the InlineShape, all Word displays is a grey panel where the field is. Conversely, if you use the docm format with a graphical object, double clicking on the field activates the Picture Tools contextual tab instead of the macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
macro, shap |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Autocorrect trigger problem | kcvinu | Word | 1 | 07-03-2015 10:41 PM |
How to trigger a html link using rules. | kitcha321 | Outlook | 1 | 06-15-2015 09:17 PM |
How Find Out What Keys Trigger My Macros? | peytontodd | Word | 1 | 10-28-2013 09:39 AM |
Hyperlink in cell to trigger pop up text box | Carpie | Excel Programming | 0 | 08-13-2013 10:33 AM |
Desperatly need help in trigger animations | quinn307 | PowerPoint | 0 | 03-27-2011 08:52 PM |