Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

get only the formats available for the active word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
edo - 09 Nov 2006 16:04 GMT
Hi all,

I use word2002.
anybody knows if it is possible with a macro to simulate the following
function:

Format > Format Template (or something like that, I have a german
version)> mouse right click on a format > highlight all the instances
of this format in the document

Thanks!
Helmut Weber - 09 Nov 2006 16:54 GMT
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

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Tony Jollans - 09 Nov 2006 16:55 GMT
I don't believe it's possible.

Signature

Enjoy,
Tony

> Hi all,
>
[quoted text clipped - 7 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.