Hello:
I am trying to create a macro that will add Footers to each section of my document. I have 4 sections on a sample document I am working on and after I run the code below, Footer on Section 1 says “Section 2”, Footer on Section 2 says “Section 3”, Footer on Section 3 says “Section 4” then Footer on Section 4 says “Section 1″. What am I doing wrong? All I want is for the Section Number to appear inside each Footer.
Sub CreateFooter()
Dim SectionCount, x
SectionCount = 0
x = 0
‘getting Section count
SectionCount = ActiveDocument.Sections.Count
‘adding Footer to each Section
For x = 1 To SectionCount
Selection.GoTo What:=wdGoToSection, Count:=x
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.HeaderFooter.LinkToPrevious = False
Selection.WholeStory
Selection.delete Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=”Seciton ” & x
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Next
Selection.HomeKey Unit:=wdStory
End Sub
Thanks,
Maria