How to intercept the click events for Style Sets in VBA? RRS feed

  • Question

  • I am trying to execute a series of if else conditions after an user selects a piece of text and chooses 'Heading1' (or any other  style) from the Style Sets (Home\Styles). Hence would like to intercept the mouse click events for the Word 2010 commands corresponding to individual styles in the Style Sets?

    I know that the following works to intercept the key board short cut ALT + CTRL + 1 (for Heading 1):

    Sub ApplyHeading1()
    MsgBox "You have executed the ApplyHeading1 command!"
    End Sub

    However, the interception only seems to work when using the keyboard shortcuts; it is not working for mouse clicks

    Tuesday, September 29, 2015 6:24 PM