D
Dennis S
I need to adjust the cell margins for all cells in a table. Through the user
interface it appears this can be done by selecting the column(s) of the table
and adjusting the table cell properites (i.e. Table>Table Properties...,Cell,
Options, Top, Left,Right, Bottom) - very quick. However, through VBA code
this is only applicable to the Table (default for entire table) or Cell, not
column. The default table values does not help since a table which already
has cell margins set are not overridden by the table default properties.
The cell overrides the table properties.
When coding for each cell, this can be more time consuming than the user
interface sine the code has to navigate each cell (which may be very slow for
large tables (over 100 cells).
This is my code:
Dim oRow as Row
Dim oCell as Cell
For Each oRow in ActiveDocument.tables(2).rows
For Each oCell in oRow.Cells
With oCell
.TopPadding = InchestoPoints(0)
.BottomPadding = InchestoPoints (0)
.LeftPadding = InchesToPoints(0.5)
.RightPadding = InchestoPoints (0)
End With
Next oCell
Next oRow
Any suggestions for improving the processing time for large table
adjustments?
interface it appears this can be done by selecting the column(s) of the table
and adjusting the table cell properites (i.e. Table>Table Properties...,Cell,
Options, Top, Left,Right, Bottom) - very quick. However, through VBA code
this is only applicable to the Table (default for entire table) or Cell, not
column. The default table values does not help since a table which already
has cell margins set are not overridden by the table default properties.
The cell overrides the table properties.
When coding for each cell, this can be more time consuming than the user
interface sine the code has to navigate each cell (which may be very slow for
large tables (over 100 cells).
This is my code:
Dim oRow as Row
Dim oCell as Cell
For Each oRow in ActiveDocument.tables(2).rows
For Each oCell in oRow.Cells
With oCell
.TopPadding = InchestoPoints(0)
.BottomPadding = InchestoPoints (0)
.LeftPadding = InchesToPoints(0.5)
.RightPadding = InchestoPoints (0)
End With
Next oCell
Next oRow
Any suggestions for improving the processing time for large table
adjustments?