Each section create different footer
Hi,
My document has got multiple sections so i need to create footer to each section. If the same section has got multiple pages then same footer for that section has to carry forward and keep the same. Can some one help me using vba code.
I tried doing manually on the word using linktoPrevious but not that much effective.
I tried the following code but using linktopreious = false it only works for footer on one page in that section not applying footer for multiple pages in that section.
currentSection = Selection.Information(wdActiveEndSectionNumber)
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.Style = ActiveDocument.Styles(styleEYHeading1)
Selection.TypeText text:=sMySec
currentSection = Selection.Information(wdActiveEndSectionNumber)
With ActiveDocument.Sections(currentSection)
.Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
.Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
WordBasic.ViewFooterOnly
Selection.TypeText text:=sMySec
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End With
Thank you for your help.
SDondeti
|