The items I modified I tried to make in red. I found that some headings were normal, some were Headings 1. I found that some had a total of three vbcr's, some had two, and some had one.
The code example you provided has gotten me where I wanted to be where I could at least loop through the headings or at least set up a search for the headings by name through the array.
Thank you again.
Sub GetHeadingNextText()
Application.ScreenUpdating = False
Dim RngHd As Range, h As Long, i As Long, strOut As String, ArrExpr()
ArrExpr = Array("Abstract:", "Author:", "Keywords:", "References:", "Title:")
For i = 0 To UBound(ArrExpr)
strOut = strOut & vbCr & ArrExpr(i)
For h = 1 To 1
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Normal"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
Do While .Find.Found
Set RngHd = .Paragraphs.Last.Range.Next
If RngHd= Vbcr then
'Report Date:(vbcr)
'March 12, 2012 (vbcr)
Set RngHd = .Paragraphs.Last.Range.Next.Paragraphs.Last.Range
End If
If RngHd = vbcr then
'Report Date:(vbcr)
'(vbcr)
'March 12, 2012 (vbcr)
Set RngHd = .Paragraphs.Last.Range.Next.Paragraphs.Last.Range.Next.Paragraphs.Last.Range
End If
If RngHd = vbcr then
'Document Title: Summary of meeting on Feburary 29, 2012.(vbcr)
Set RngHd = .Paragraphs.Last.Range
End If
With RngHd
.End = .End - 1
strOut = strOut & vbCr & .Text
End With
.Start = RngHd.End + 1
.Find.Execute
Loop
End With
Next
Next
Set RngHd = Nothing
MsgBox "The following text is associated with -" & strOut
Application.ScreenUpdating = True
End Sub