A
andreas
Dear Experts:
I got a word 2003 document in which all the tables do not have any
left or right cell padding.
I tried to customize the left and right cell padding of a selected
Word table with the following code.
But nothing happens. The left and right cell padding remain at 0 cm.
Only the first part of the code seems to work (but this has got no
effect on the left and right cell padding), the second part starting
with 'With Selection.Cells(1) ... obviously has got no effect
whatsoever. Is this a bug?
Help is much appreciated. Thank you very much in advance. Regards,
Andreas
Sub CustomizeCellPadding()
(PART 1 of the code)
Selection.Tables(1).Select
With Selection.Tables(1)
.TopPadding = CentimetersToPoints(0)
.BottomPadding = CentimetersToPoints(0)
.LeftPadding = CentimetersToPoints(0.2)
.RightPadding = CentimetersToPoints(0.2)
End With
(PART 2 of the code)
Selection.Tables(1).Select
With Selection.Cells(1)
.TopPadding = CentimetersToPoints(0)
.BottomPadding = CentimetersToPoints(0)
.LeftPadding = CentimetersToPoints(0.2)
.RightPadding = CentimetersToPoints(0.2)
.WordWrap = True
.FitText = False
End With
End Sub
I got a word 2003 document in which all the tables do not have any
left or right cell padding.
I tried to customize the left and right cell padding of a selected
Word table with the following code.
But nothing happens. The left and right cell padding remain at 0 cm.
Only the first part of the code seems to work (but this has got no
effect on the left and right cell padding), the second part starting
with 'With Selection.Cells(1) ... obviously has got no effect
whatsoever. Is this a bug?
Help is much appreciated. Thank you very much in advance. Regards,
Andreas
Sub CustomizeCellPadding()
(PART 1 of the code)
Selection.Tables(1).Select
With Selection.Tables(1)
.TopPadding = CentimetersToPoints(0)
.BottomPadding = CentimetersToPoints(0)
.LeftPadding = CentimetersToPoints(0.2)
.RightPadding = CentimetersToPoints(0.2)
End With
(PART 2 of the code)
Selection.Tables(1).Select
With Selection.Cells(1)
.TopPadding = CentimetersToPoints(0)
.BottomPadding = CentimetersToPoints(0)
.LeftPadding = CentimetersToPoints(0.2)
.RightPadding = CentimetersToPoints(0.2)
.WordWrap = True
.FitText = False
End With
End Sub