Hi Edo,
so you want to add a macro to the menu displayed
when right clicking in "styles and formatting".
Must be pretty complicated and I wonder,
whether it is worth the effort.
I'd set up a userform,
read all styles in the doc,
which may take some time for a large document,
as "show: styles in use" does not return
the expected result.
I really don't know what is about.
There is no PrgGreen-Style in use in my test-doc.
Though, PrgGreen is in the list of styles in use.
Maybe I am totally off the track.
Put the names of styles in the doc
in a listbox, and highlight all paragraphs
in that style, when doubleclicking.
Not to forget removing highlighting before.
Assumed that this is about paragraph styles only.
Or, in a very simplified approach,
highlight all paragraphs of the style
of the first paragraph in the selection, like:
Sub Macro1()
Dim sStl As String
Dim oPrg As Paragraph
sStl = selection.Paragraphs(1).Style
ActiveDocument.Range.HighlightColorIndex = wdNoHighlight
For Each oPrg In ActiveDocument.Range.Paragraphs
If oPrg.Style = sStl Then
oPrg.Range.HighlightColorIndex = wdYellow
End If
Next
End Sub
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"