I need to adjust the tab settings in a footer based on whether the section is in landscape or portrait orientation.
I've tried the following code:
Dim sec As Section
For Each sec In ActiveDocument.Sections
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.ParagraphFormat.TabStops.ClearAll
ActiveDocument.DefaultTabStop = InchesToPoints(0.5)
If sec.PageSetUp.Orientation = wdOrientPortrait then
Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(2.88), _
Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(5.75), _
Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
Else
' Set tabs for landscape orientation here
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Next sec
End Sub
But I get an "This command is not available" from the sec.PageSetUp.Orientation.
Help, please. What am I doing wrong?
Many thanks!
Larry Landis
[email protected]
Larry Landis
Technical Writer