F
Fernando Ronci
Hi,
I've got a 1500+ lines MS-Word 2003 document that contains plenty of short
articles. Each article begins with a bulleted, bold-type title, styled with
the 7th bullet from Word's bullet gallery found at "Format | Bullets and
Numbering".
I want a macro that does the following:
- parse the whole document and extract all bulleted lines styled with the
7th bullet.
- populate a listbox with the titles (extracted above) so that I can choose
a topic and jump to the corresponding article.
I'm new to VBA programming and don't know how to tackle the problem.
I barely was able to get the line count with a piece of code I copied and
pasted from somewhere like so:
Dim NumLines As Long
With ActiveDocument.Range.Find
.ClearFormatting
.Format = False
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
End With
NumLines = ActiveDocument.ComputeStatistics(wdStatisticLines)
MsgBox ("The document contains " & NumLines & " Lines")
End Sub
So, NumLines holds the document's line count. Now, how do I continue from
here to get the rest done? (Word's object model is huge and I'm stuck).
Guidelines and pointers appreciated.
Thank you.
Fernando Ronci
E-mail: (e-mail address removed)
I've got a 1500+ lines MS-Word 2003 document that contains plenty of short
articles. Each article begins with a bulleted, bold-type title, styled with
the 7th bullet from Word's bullet gallery found at "Format | Bullets and
Numbering".
I want a macro that does the following:
- parse the whole document and extract all bulleted lines styled with the
7th bullet.
- populate a listbox with the titles (extracted above) so that I can choose
a topic and jump to the corresponding article.
I'm new to VBA programming and don't know how to tackle the problem.
I barely was able to get the line count with a piece of code I copied and
pasted from somewhere like so:
Dim NumLines As Long
With ActiveDocument.Range.Find
.ClearFormatting
.Format = False
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
End With
NumLines = ActiveDocument.ComputeStatistics(wdStatisticLines)
MsgBox ("The document contains " & NumLines & " Lines")
End Sub
So, NumLines holds the document's line count. Now, how do I continue from
here to get the rest done? (Word's object model is huge and I'm stuck).
Guidelines and pointers appreciated.
Thank you.
Fernando Ronci
E-mail: (e-mail address removed)