Macros in MS Word

This is a discussion on Macros in MS Word within the Tech Board forums, part of the Community Boards category; Very frustrated right now, I hope I've just missed something and someone will quickly point it out. So in almost ...

  1. #1
    Epy
    Epy is offline
    Fortran lover Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    949

    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.

  2. #2
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    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
    Consider this post signed

  3. #3
    Epy
    Epy is offline
    Fortran lover Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    949
    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]

  4. #4
    Epy
    Epy is offline
    Fortran lover Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    949
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MS Word misspelling
    By jmd15 in forum Windows Programming
    Replies: 2
    Last Post: 10-13-2005, 06:57 PM
  2. creating MS word documents
    By srraajesh in forum Windows Programming
    Replies: 2
    Last Post: 07-21-2005, 01:40 AM
  3. The Timing is incorret
    By Drew in forum C++ Programming
    Replies: 5
    Last Post: 08-28-2003, 04:57 PM
  4. Word Count
    By simple in forum C Programming
    Replies: 12
    Last Post: 10-04-2002, 10:47 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21