Setting default margins in table cells w/VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm creating a table programmatically, one row at a time. In Powerpoint 2K I set the default cell margins for the first row using the code below.

set tbl = activeslide.shapes.addtable(1, cols, ...)
for each cell in tbl.Rows(1).Cells
with cell.shape.TextFrame
.MarginTop = 2
.MarginLeft = 2
.MarginRight = 2
.MarginBottom = 2
end with
next

Works great in PPT2K, but not in Powerpoint 2003. Any ideas how to accomplish the same thing in 2003.

Thanks.
 
' =========== Code Block ============
Dim TBLShape As Shape
Set TBLShape = ActiveWindow.Selection.SlideRange(1).Shapes.AddTable(1, 3)
For Each Cell In TBLShape.Table.Rows(1).Cells
With Cell.Shape.TextFrame
.MarginTop = 2
.MarginLeft = 2
.MarginRight = 2
.MarginBottom = 2
End With
Next
' ========== End of Block ===========
 
Back
Top