Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2006, 06:22 PM
Registered User
 
Join Date: Sep 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default While in footer, determining section orientation

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
 
Old December 29th, 2006, 03:26 AM
GLM GLM is offline
Authorized User
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you have activated Footer, and trying to configure the section-
you have no sections inside the Footer

glm





Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Orientation sreechand_b J2EE 0 June 3rd, 2005 03:56 AM
Report Orientation Problem echovue Access 1 January 11th, 2005 01:35 PM
Table Orientation blaflin BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 November 11th, 2004 01:36 PM
Data Report: Orientation blackdevil1979 Beginning VB 6 1 September 9th, 2004 11:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.