-
Macros in MS Word
Very frustrated right now, I hope I've just missed something and someone will quickly point it out.
So in almost every version of Excel, it is SOOOOOOOOO easy to assign a macro to just about anything. However, in Word it seems almost next to impossible to assign a macro to anything, except for a recorded macro.
It's ridiculous...in Excel, shapes have an OnAction property that makes it very easy to programmatically assign a macro...this property is absent in Word.
Anyone have any ideas? Thanks in advance.
-
You could probably assign the OnAction property via the VBA macro editor if you can't find it anywhere else. Though you should see all the same properties between excel and word. Maybe you're not in "developer mode", or whatever it's called?
But hey, I haven't used MS Office for years (seriously) so don't quote me on that.
A few links, maybe they'll help.
Managing macros with the Visual Basic Editor - Support - Microsoft Office
How to: Show the Developer Tab on the Ribbon
-
I tried assigning it from the VBA editor, couldn't really assign it from anywhere else in my predicament. The OnAction prop is missing.
Word:
Shape Object
Excel:
Shape Object [Excel 2003 VBA Language Reference]
-
Okay, apparently you have to insert a "macrobutton" field...which I tried before, it just didn't work because you have to save, close, and reopen, then enable macro content in order for it to work. The field ends up looking like such:
Code:
{ Macrobutton functionname content }
where the content can be anything, text, shapes, etc.