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 / December 2006

Tip: Looking for answers? Try searching our database.

How Many Paragraphs use a Particular Style?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frankbelly - 06 Dec 2006 04:00 GMT
I think Word 2003 handles this better, but I'm using Word 2000 and I'm trying
to figure out how many paragraphs are using a particular style.  Is there an
easy way to get a number value for how many paragraphs in the active document
are styled under a certain style name?

Thanks for any help.
Greg Maxey - 06 Dec 2006 04:08 GMT
Sub ScratchMacro()
Dim oPar As Paragraph
Dim i As Long
For Each oPar In ActiveDocument.Range.Paragraphs
 If oPar.Style = "Normal" Then
   i = i + 1
 End If
Next
MsgBox i
End Sub

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> I think Word 2003 handles this better, but I'm using Word 2000 and
> I'm trying to figure out how many paragraphs are using a particular
[quoted text clipped - 3 lines]
>
> Thanks for any help.
 
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.