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 / Numbering / November 2003

Tip: Looking for answers? Try searching our database.

How to search all numbered paragraphs regardless style

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Artur - 08 Nov 2003 15:11 GMT
Hi all,

I'm sorry, asking such basic question but the issue seems tricky for me.

Most of users do not use styles wisely, they use buttons. Unfortunatelly,
applying automatic paragraph numbering (listing) via buttons does not keep
specyfic styles.

How can I search/mark/extract/cut paragraphs (just set range on them) using
VBA (MS Word XP) JUST USING THE FACT THAT THEY ARE NUMBERED (or listed by
bullets), regardless their style name.

Thanx in advance,

Artur
Bruce Brown - 08 Nov 2003 21:21 GMT
Your message is not specific enough.  What exactly do you want to do?
And which numbering styles are you using?

> Hi all,
>
[quoted text clipped - 11 lines]
>
> Artur
Bruce Brown - 11 Nov 2003 15:11 GMT
Artur

Maybe this is what you're looking for. It stops only for numbered
paragraphs, skipping unnumbered and bulleted paragraphs. It selects
the paragraph, tells you what kind of numbering it is and what the
paragraph style is, then asks if you want to stop there.  A little
sloppy but it works.

Sub ShowNumberedParasOnly()
Dim P As Paragraph, Ans As Byte
ActiveWindow.ActivePane.View.ShowFieldCodes = True
For Each P In ActiveDocument.Paragraphs
   P.Range.Select
   Select Case P.Range.ListFormat.ListType
   Case Is = 1
   Ans = MsgBox("Numbering type = Field numbering" & vbCr & _
         "Style = " & Selection.Style.NameLocal, vbYesNo, "Stop?")
    If Ans = 6 Then Exit Sub
    Case Is = 3
    Ans = MsgBox("Numbering type = Simple list" & vbCr & _
          "Style = " & Selection.Style.NameLocal, vbYesNo, "Stop?")
    If Ans = 6 Then Exit Sub
    Case Is = 4
    Ans = MsgBox("Numbering type = Outline numbering" & vbCr & _
          "Style = " & Selection.Style.NameLocal, vbYesNo, "Stop?")
     If Ans = 6 Then Exit Sub
     Case Is = 5
     Ans = MsgBox("Numbering type = Mixed numbering" & vbCr & _
           "Style = " & Selection.Style.NameLocal, vbYesNo, "Stop?")
     If Ans = 6 Then Exit Sub
   End Select
Next
End Sub

> Your message is not specific enough.  What exactly do you want to do?
> And which numbering styles are you using?
[quoted text clipped - 14 lines]
> >
> > Artur
 
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.