Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
put a button on a toolbar to set orientation to landscape
I want a button on the toolbar to set orientation to landscape without having
to use page setup button |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
put a button on a toolbar to set orientation to landscape
Hi scholars
world bible school wrote: I want a button on the toolbar to set orientation to landscape without having to use page setup button The following macro, put on a toolbar button (Tools | Customize | Commands | Macros, push the macro into an existing or new taskbar -- as long as you have access to taskbars, that is, Word 2003-related joke :-)), changes the orientation of the section the cursor is in (or of the first section in the selection if you have selected something): Sub ToggleOrientation() With Selection.Sections(1).PageSetup If .Orientation = wdOrientLandscape _ Then .Orientation = wdOrientPortrait _ Else .Orientation = wdOrientLandscape End With End Sub I have not tested this for things like what happens when the selection is in a textbox or header etc. For anyone more familiar with VBA than myself (which doesn't mean much at all! :-)), the slightly shorter version taking advantage of knowing what the wdOrient constants' values are, would be: Sub ToggleOrientation1() With Selection.Sections(1).PageSetup .Orientation = 1 - .Orientation End With End Sub But I have no clue whether this is as safe as the above (and it's certainly less readable ...). Greetinx Robert -- /"\ ASCII Ribbon Campaign | MS \ / | MVP X Against HTML | for / \ in e-mail & news | Word |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
put a button on a toolbar to set orientation to landscape
Hi ?B?d29ybGQgYmlibGUgc2Nob29s?=,
I want a button on the toolbar to set orientation to landscape without having to use page setup button It appears there isn't any direct command for this that can be assigned to a button. You'd need to use a macro assigned to a button. For example: Sub LandscapePaper() ActiveDocument.PageSetup.Orientation = wdOrientLandscape End Sub Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
WORD 2003 color fill button does not allow selection | Microsoft Word Help | |||
Opening a file on my HDD via a Toolbar button | New Users | |||
Modify custom toolbar button behaviour | Microsoft Word Help | |||
I can't delete a toolbar button from the standard toolbar | Microsoft Word Help | |||
How do I get all my Word documents within one Word window | Microsoft Word Help |