

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 72
set thisBorder to get border which border edge left
my ModifyBorder(thisBorder)
set thisBorder to get border which border edge right
my ModifyBorder(thisBorder)
set thisBorder to get border which border edge top
my ModifyBorder(thisBorder)
set thisBorder to get border which border inside horizontal
my ModifyBorder(thisBorder)
set thisBorder to get border which border inside vertical
my ModifyBorder(thisBorder)
end tell
end tell
on ModifyBorder(thisBorder)
tell application "Microsoft Excel"
try
set line style of thisBorder to double
end try
try
set color index of thisBorder to 3
end try
end tell
return
end ModifyBorder
This is actually more efficient. Either method works well. You need change only the commands, in the ModifyBorder handler or in the repeat loop of the first method, to apply different effects to all your borders.
Most of the time you will be setting properties of just one, or a few, borders. Here is what the VBA version might look like:
With ActiveSheet.Range("D10")
.Borders.LineStyle = xlNone ' Remove existing borders
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 3
End With
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
< Previous Page Next Page>

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