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 36
set myRange to text object of paragraph 1 of myRange
set myRange to (move end of range myRange ¬
by a paragraph item count 1)
else
--if two paragraphs aren't identical, add the one after
--that to my range, so it can be checked, and drop
--the first one, since it is no longer of interest.
set myRange to (move end of range myRange ¬
by a paragraph item count 1)
try
set myRange to (move start of range myRange ¬
by a paragraph item count 1)
on error -- last paragraph (missing value, so can't move start)
exit repeat -- finish
end try
end if
end repeat
end tell
Delete all empty rows in a table
(VBA macro by Word MVPs Dave Rado and Ibby)
Public Sub DeleteEmptyRows()
Dim oTable As Table, oRow As Range, oCell As Cell, Counter As Long, _
NumRows As Long, TextInRow As Boolean
' Specify which table you want to work on.
Set oTable = Selection.Tables(1)
' Set a range variable to the first row's range
Set oRow = oTable.Rows(1).Range
NumRows = oTable.Rows.Count
Application.ScreenUpdating = False
For Counter = 1 To NumRows
StatusBar = "Row " & Counter
TextInRow = False
For Each oCell In oRow.Rows(1).Cells
If Len(oCell.Range.Text) > 2 Then
'end of cell marker is actually 2 characters
TextInRow = True
Exit For
End If
Next oCell
If TextInRow Then
Set oRow = oRow.Next(wdRow)
Else
oRow.Rows(1).Delete
End If
< Previous Page Next Page>
- SPREAD THE WORD:
- Slashdot
- Digg
- Del.icio.us
- Newsvine