Aligning table cell contents based on style
- From: "david_alex_smith" <davidalexsmith@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 10 May 2005 02:26:02 -0700
Hello.
I'm trying to align all table cell contents to the bottom of the cell if
they are "Table Heading Style".
I've written the following macro to do this.
Sub AlignTables()
'Aligns table headings
Dim Table, aRow, aCell, myRange
For Each Table In ActiveDocument.Tables
For Each aRow In Table.Rows
For Each aCell In aRow.Cells
myRange = aCell
If myRange.Style = "Table Heading" Then
aCell.VerticalAlignment = wdAlignVerticalBottom
End If
Next aCell
Next aRow
Next Table
End Sub
This doesn't work though. I get an error - "Object variable or With block
variable not set".
Any ideas how I can get this working. Thanks in advance.
Dave.
.
- Follow-Ups:
- Re: Aligning table cell contents based on style
- From: Jean-Guy Marcil
- Re: Aligning table cell contents based on style
- Prev by Date: Re: Macro for sending Word doc via e-mail
- Next by Date: Re: Automating steps to copy URL from IE into Word
- Previous by thread: Can't use 'optinal' when using Application.Run
- Next by thread: Re: Aligning table cell contents based on style
- Index(es):
Relevant Pages
|