Navigate to a specific numbered paragraph

M

mamil

Hi Gurus.

I'm trying to automate word to perform the following tasks:
1. Open a given document (no problem)
2. Navigate to paragraph numbered 4.1
3. Get its content

I have no idea how to perform steps 2 & 3.
Can you help me with that?

Thanks!
 
H

Helmut Weber

Hi,

maybe you're searching for something like this:


Sub test3223()
Dim rPrg As Paragraph
For Each rPrg In ActiveDocument.ListParagraphs
If rPrg.Range.ListFormat.ListString = "2.1" Then
rPrg.Range.Select
MsgBox rPrg.Range.Text
End If
Next
End Sub

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top