S
Susan Taylor
I am using the following code to loop through a document and insert
text into the footers based on the footer type - this works until I
reach the last section - here it inserts the text two times - can
someone assist?
sect_count = ActiveDocument.Sections.count
For count = 1 To sect_count
For Each sect In ActiveDocument.Sections
If sect.footers(wdHeaderFooterFirstPage).Exists Then
ActiveWindow.ActivePane.View.SeekView = wdSeekFirstPageFooter
'insert first page text
ElseIf sect.footers(wdHeaderFooterEvenPages).Exists Then
ActiveWindow.ActivePane.View.SeekView = wdSeekPrimaryFooter
'insert some text
Else: ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
'insert some different text
End If
Next
Next
thank you,
Susan Taylor
text into the footers based on the footer type - this works until I
reach the last section - here it inserts the text two times - can
someone assist?
sect_count = ActiveDocument.Sections.count
For count = 1 To sect_count
For Each sect In ActiveDocument.Sections
If sect.footers(wdHeaderFooterFirstPage).Exists Then
ActiveWindow.ActivePane.View.SeekView = wdSeekFirstPageFooter
'insert first page text
ElseIf sect.footers(wdHeaderFooterEvenPages).Exists Then
ActiveWindow.ActivePane.View.SeekView = wdSeekPrimaryFooter
'insert some text
Else: ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
'insert some different text
End If
Next
Next
thank you,
Susan Taylor