

Moving from Microsoft Office VBA to AppleScript:
MacTech's Guide to Making the Transition
Introduction
|
Table of Contents
Page Prev and Page Next buttons at bottom of the page.
|
April, 2007
Page 85
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
To fit pages to a certain height or width, you must set the Zoom property to False:
With ActiveWorkbook.Sheets("Sheet1").PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 2
End With
That goes very straightforwardly into AppleScript:
tell application "Microsoft Excel"
tell page setup object of active sheet
set print title rows to "$1:$2"
set print area to "" -- determine at print time
set left header to ""
set center header to "My Report"
set right header to ""
set left footer to "Page &P of &N"
set center footer to ""
set right footer to "&Z&F"
set left margin to inches to points inches 1.0
set right margin to inches to points inches 1.0
set top margin to inches to points inches 1.5
set bottom margin to inches to points inches 1.5
set header margin to inches to points inches 0.5
set footer margin to inches to points inches 0.5
set print headings to false
set print gridlines to false
set print quality to -4
set center horizontally to false
set center vertically to false
set page orientation to landscape
< Previous Page Next Page>

- SPREAD THE WORD:
- Slashdot
- Digg
- Del.icio.us
- Newsvine