What kind ot cursor object to use in para style box?

Hi,

i can move the cursor to the para style box with a dispatcher command. But I cannot access the cursor in that box with the macro.

Background: What I’m aiming at is the easiest way to assign a parastyle while writing/editing a document without using the mouse.

Normal procedure:

  1. Click or use shortcut to set cursor to parastylebox.

  2. Navigate to desired parastyle using arrows (could make many hits necessary) or highlight all, then …

  3. hit initial character(s) of desired style.

I want to write a macro that does 1) – which is easy using dispatcher - and then highlights whatever is in the box (which I have not found a solution for so far) so as to be able to do 3).

I know I could easily write a macro to assign certain styles, but the names of these styles change from doc to doc which would make a macro rewrite necessary. I also thought about a solution that enumerates all used parastyles into a select box, then let the user choose and apply selected choice to current paragraph, but I deemed the first solution simpler. Which it might not be.

Thanks
Udo

(edited by ajlittoz to improve legibility)

Could you edit your question to explain your ultimate goal. I feel you have a method failure in your document formatting, like a misuse of styles. If your document is correctly structured (semantically marked up with styles) you don’t need to fully restyle it Changing its appearance is done solely through style updating.

Also to guarantee style consistency across documents, base them on the same template.

When styling a document, you don"t use tons of styles but only a handful. Consequently, there are enough free key combinations to assign them as a shortcut. No need to go for a macro.

Tools>Customize, Keyboard tab is your friend. In Category, expand the Styles sub menu. The advantage is you can shortcut not only paragraph styles but also all others.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.