View Single Post
 
Old 05-18-2011, 07:04 AM
SDondeti SDondeti is offline Windows XP Office 2007
Novice
 
Join Date: Apr 2011
Posts: 7
SDondeti is on a distinguished road
Default 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
Reply With Quote