Public Sub ExtractText()
Dim para As Paragraph
For Each para In ActiveDocument.Paragraphs
If para.Format.Style Like "Heading [3]" Then
Debug.Print para.Range.Text
End If
Next para
End Sub
Sub GetText()
Dim iParagraphCount As Integer
Dim iParagraphCntr As Integer
iParagraphCount = ActiveDocument.Paragraphs.Count
For iParagraphCntr = 1 To iParagraphCount
If ActiveDocument.Paragraphs(iParagraphCntr).Style = ActiveDocument.Styles("Heading 3") Then
MsgBox ActiveDocument.Paragraphs(iParagraphCntr).Range.Text & " " & ActiveDocument.Paragraphs(iParagraphCntr + 1).Range.Text
End If
Next
End Sub
Open in new window