Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2011, 07:04 AM
SDondeti SDondeti is offline Each section create different footer Windows XP Each section create different footer Office 2007
Novice
Each section create different footer
 
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
  #2  
Old 05-18-2011, 02:40 PM
macropod's Avatar
macropod macropod is offline Each section create different footer Windows 7 32bit Each section create different footer Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,927
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi SDondeti,

Try:
Code:
Sub Demo()
Dim Ftr As HeaderFooter, i As Long
With ActiveDocument
  For i = 2 To .Sections.Count
    For Each Ftr In .Sections(i).Footers
      Ftr.LinkToPrevious = True
    Next
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Each section create different footer is it possible to create hyperlink from page numbers in footer? khsharpe Word 2 04-21-2011 02:49 AM
Different Colors for Each Section? l1willia Word 0 12-30-2010 11:49 AM
Section Breaks, maybe? R20 Word 2 12-20-2009 06:35 PM
Section Breaks glenws Word 1 11-05-2009 02:10 PM
Section Break ODD Manolo Word 0 04-29-2009 11:06 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft