Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 7th, 2006, 05:22 PM
Registered User
 
Join Date: Sep 2003
Location: Tulsa, Oklahoma, USA.
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
lawrence_landis@yahoo.com

Larry Landis
Technical Writer
Reply With Quote
  #2 (permalink)  
Old December 29th, 2006, 02:26 AM
GLM GLM is offline
Authorized User
 
Join Date: Dec 2006
Location: , , .
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:35 PM
Table Orientation blaflin BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 November 11th, 2004 12:36 PM
Data Report: Orientation blackdevil1979 Beginning VB 6 1 September 9th, 2004 11:57 AM



All times are GMT -4. The time now is 04:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.