View Single Post
 
Old 04-25-2012, 05:44 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

Quote:
Using just the first section break does not retain the header/footer no link, or the orientation, or the page numbering (continue) properties.
That suggests you're doing something wrong. The default behaviour is to retain all of these.

A Word-oriented book that I did a technical review on, that you may find useful, is The Secret Life of Word, by Robert Delwood, published by XML Press (http://xmlpress.net)

Here's some basic code to add a landscape Section at the current insertion point:
Code:
Sub AddLandscapeSection()
Application.ScreenUpdating = False
Dim Sctn As Section, oHdFt As HeaderFooter
With Selection
  Set Sctn = .Sections.Add(Range:=.Range, Start:=wdSectionNewPage)
  With Sctn
    MsgBox .Range.Text
    With .PageSetup
      .PaperSize = wdPaperA4
      .Orientation = wdOrientLandscape
      .MirrorMargins = True
      .TopMargin = CentimetersToPoints(2.5)
      .BottomMargin = CentimetersToPoints(2.5)
      .LeftMargin = CentimetersToPoints(2.5)
      .RightMargin = CentimetersToPoints(2.5)
      .DifferentFirstPageHeaderFooter = True
    End With
    For Each oHdFt In .Headers
      oHdFt.LinkToPrevious = True
      'If oHdFt.LinkToPrevious = False Then oHdFt.Range.Text = "Some Text"
    Next
    For Each oHdFt In .Footers
      oHdFt.LinkToPrevious = True
      oHdFt.LinkToPrevious = True
      'If oHdFt.LinkToPrevious = False Then oHdFt.Range.Text = "Some Text"
    Next
  End With
  Set Sctn = Nothing
End With
Application.ScreenUpdating = True
End Sub
Whether you'll need all the parameters, or others I haven't indicated, depends on what your needs are.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote