Eric,
And here's an uncrude example, which may serve to illustrate just how
crude-and-rude the whole process can be. ;) This macro sets up the
separate section for a landscape page, then duplicates the presumably
existing plain-page-number-in-the-center footer, placing it on the
landscape page in portrait orientation. It assumes the page number
has been entered using the Page Number button on the Header/Footer
Toolbar, not with the vile Insert-> Page Numbers menu.
Hope this helps. (And sorry if it frightens....)
Sub InsertLandscapePage
Dim tbx As TextBox, r As Range, f As HeaderFooter, LanPageExists As Boolean
Dim s As Section, i As Long, sha As Shape, secnum As Long
For Each s In ActiveDocument.Sections
If s.PageSetup.Orientation = wdOrientLandscape Then
LanPageExists = True
Exit For
End If
Next s
With Selection
.InsertBreak Type:=wdSectionBreakNextPage
.TypeText vbCr & vbCr & vbCr
.InsertBreak Type:=wdSectionBreakNextPage
End With
ActiveWindow.ActivePane.View.Type = wdPageView
With Selection.Sections(1)
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).PageNumbers.RestartNumberingAtSection _
= False
End With
Selection.MoveLeft wdCharacter, 3
With Selection.Sections(1)
.PageSetup.Orientation = wdOrientLandscape
.PageSetup.LeftMargin = InchesToPoints(1.4) 'ADJUST TO SUIT
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).Range.Text = ""
End With
Set f = Selection.Sections(1).Footers(wdHeaderFooterPrimary)
Set r = f.Range
If LanPageExists = False Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
' First kill off any existing shapes in the footer
For i = f.Shapes.Count To 1 Step -1
f.Shapes(i).Delete
Next i
Set sha = f.Shapes.AddTextbox(Orientation:=msoTextOrientationDownward, _
Left:=0, Top:=0, Width:=36, Height:=36, Anchor:=r)
With sha
.TextFrame.TextRange.ParagraphFormat.Alignment = wdAlignParagraphCenter
.TextFrame.TextRange.Fields.Add Range:=sha.TextFrame.TextRange, _
Type:=wdFieldPage, PreserveFormatting:=False
.Line.Visible = msoFalse
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.Left = InchesToPoints(0.3) 'ADJUST TO SUIT
.Top = InchesToPoints(4.1) 'ADJUST TO SUIT
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.TypeText "INSERT_TABLE_HERE"
Else
secnum = Selection.Information(wdActiveEndSectionNumber)
For i = 1 To ActiveDocument.Sections.Count
If ActiveDocument.Sections(i).PageSetup.Orientation = wdOrientLandscape _
And secnum <> i Then Exit For
Next i
Selection.Sections(1).Footers(wdHeaderFooterPrimary).Range. _
FormattedText = ActiveDocument.Sections(i). _
Footers(wdHeaderFooterPrimary).Range.FormattedText
End If
End Sub
-- See the MVP FAQ at http://www.mvps.org/word --------------------------
----------------- "Life is nothing if you're not obsessed." --John Waters
-------------------------------------------------------------------------
Reply to group ONLY. Do not attach files. MVPs do not work for Microsoft.
Quote:
> Thanks for the quick response!
> >-----Original Message-----
> >Hi Eric,
> >Yes, you will need to insert a section break each time
> you want to change
> >the orientation and set the orientation as well. Here's a
> crude example:
> >Selection.InsertBreak wdSectionBreakNextPage
> >Selection.Sections(1).PageSetup.Orientation =
> wdOrientLandscape
> >HTH
> >> Is it possible to programatically build a document that
> >> has some pages in portrait and others in landscape? If
> >> not, is it possible to build two documents that are
> >> seemlessly linked together for the end user?
> >> Thanks in advance,
> >> Eric Goff
> >.