Collate all footer info into one page like a TOC

F

FotoArt

Hi everyone
my document is divided into sections
Each section has about three pieces of information(wordcount,
lengthin_h:M:s, sometext) in footers.
How could I get them all into one page like a TOC

like so

section1
sometext
wordCount
lengthin_h:M:s

section2
sometext
wordCount
lengthin_h:M:s

Any help would be appreciated
best wishes
ahmed
 
O

old man

Hi,

I am assuming that the info is already in the footers...

Dim allfootertext As String
Dim cursection As Section
Dim str2 As String
Dim headerfooter1 As HeaderFooter
Dim str3 As String
Dim cursectionnumber As Integer


str3 = " "
cursectionnumber = 0

For Each cursection In ActiveDocument.Sections
cursectionnumber = cursectionnumber + 1
For Each headerfooter1 In cursection.Footers
If headerfooter1.Exists Then
str2 = "section" & cursectionnumber & vbCrLf &
headerfooter1.Range.Text

End If
If Len(Trim(str2)) > 0 Then
If str3 <> str2 Then

allfootertext = allfootertext & str2 & vbCrLf & vbCrLf
End If
str3 = str2
End If
Next
Next

Selection.HomeKey Unit:=wdStory
Selection.TypeText allfootertext

Each section can have multiple headers and/or footers and I assume that they
are not linked to the previous header/footer. I don't know if there are
unique footers in a section so I eliminate duplicates through the use of
str3. At the end I insert all the text in the start of the document....

old man
 

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