F
Fred Holmes
Word 2003
In a Table, using a macro, I am trying to set the cell margins/padding
back to the "default" value. This operation is accomplised manually
by:
Tables => Table Properties => Cell => Options => Cell Margins =>
checkbox: Same as the whole table. (which sets "cell padding")
I can do the inverse, customize the cell padding to explicit custom
values for the cell with, e.g., the following working vba code:
With Selection.Cells(1)
.TopPadding = InchesToPoints(0.05)
.BottomPadding = InchesToPoints(0.05)
.LeftPadding = InchesToPoints(0.05)
.RightPadding = InchesToPoints(0.05)
.WordWrap = True
.FitText = False
End With
which code was obtained by recording "keystrokes" (mouse clicks and
keystrokes).
If I then run a record-keystroke macro to remove the custom padding
from the cell I get only the last two lines of code (.WordWrap and
..FitText). The "TopPadding =", etc., statements are missing
altogether. But running this "remove" macro doesn't work. The
existing custom padding/margins in the selected cell remains.
Is there a VBA statement that will remove the custom padding from the
selected cell and set it to the value assigned for the entire table?
I've tried:
.TopPadding = Nothing
and
.TopPadding = -1
Neither work. If I write code to query the value, it returns -1, but
if I try to set it to -1 the error message says that the value to be
set must be between 0 and some positive number (I forget the exact
value).
Thanks,
Fred Holmes
I chose to post this under "Tables" rather than macros or VBA, and did
not cross-post. Hope I did it correctly.
In a Table, using a macro, I am trying to set the cell margins/padding
back to the "default" value. This operation is accomplised manually
by:
Tables => Table Properties => Cell => Options => Cell Margins =>
checkbox: Same as the whole table. (which sets "cell padding")
I can do the inverse, customize the cell padding to explicit custom
values for the cell with, e.g., the following working vba code:
With Selection.Cells(1)
.TopPadding = InchesToPoints(0.05)
.BottomPadding = InchesToPoints(0.05)
.LeftPadding = InchesToPoints(0.05)
.RightPadding = InchesToPoints(0.05)
.WordWrap = True
.FitText = False
End With
which code was obtained by recording "keystrokes" (mouse clicks and
keystrokes).
If I then run a record-keystroke macro to remove the custom padding
from the cell I get only the last two lines of code (.WordWrap and
..FitText). The "TopPadding =", etc., statements are missing
altogether. But running this "remove" macro doesn't work. The
existing custom padding/margins in the selected cell remains.
Is there a VBA statement that will remove the custom padding from the
selected cell and set it to the value assigned for the entire table?
I've tried:
.TopPadding = Nothing
and
.TopPadding = -1
Neither work. If I write code to query the value, it returns -1, but
if I try to set it to -1 the error message says that the value to be
set must be between 0 and some positive number (I forget the exact
value).
Thanks,
Fred Holmes
I chose to post this under "Tables" rather than macros or VBA, and did
not cross-post. Hope I did it correctly.