question

DavidRuss-6827 avatar image
0 Votes"
DavidRuss-6827 asked

Running VBA Code In WORD following user selection of existing command

How do I set up a VBA procedure to execute when a user makes a selection from one of the existing commands in word. Specifically I want a VBA routine that I have written to run when a user applies a specific style to a paragraph in the word document.

As I understand things when a user selects to apply a style in a document by picking one of the styles in the style menu WORD applies the "Style" method to the "Selection" Object and this is set to equal the specific named style that has been defined in the Active Document based on which style the user has clicked on.... What I want to do is identify when the "Style" method has been called and if the specific named style is the one being applied I then want to run my VBA code.

Is there any way to establish this as a trigger to initiate the running of my VBA Code?

office-vba-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers