no spacing between cells in table

L

Lisa

Working in Word 2003. If you format a table using the Word menus/dialogs, you
have the option of not allowing spacing between cells. (Table | Table
Properties. On the Table tab, Options then remove checkmark in front of
"Allow spacing between cells.")

When I try to accomplish the same thing via VBA, it doesn't really remove
the spacing, it sets the spacing to 0. Spacing at 0 doesn't look quite the
same as "Allow spacing = False."

Both of the following give the same results. 0 spacing, but "Allow spacing
between cells" is still true (checked) in the Options dialogbox -- and the
table looks a wee bit funny.

Selection.Tables(1).Spacing = 0
And
Selection.Tables(1).Spacing = False

I can't find anything re. how to set between-cell spacing other than the
Spacing property.
Is there a way I can use VBA to essentially say "Allow spacing between cells
= False"?
 
L

Lisa

Thanks again for the tip, Lene.
This is just an update for potential benefit of other forum participants...

The article you directed me to had two potential work arounds... One set
spacing to a negative ("-1") which gave the right appearance but left "Allow
spacing between cells" checked in the Table Options dialog box. The other
displayed the dialog and used the Send key to change the setting.

I couldn't make the second approach work for me at all, but it certainly
pointed me in the right direction. Using Word 2003, the following unchecks
the "Allow spacing between cells" checkbox and removes between cell spacing
in the selected table.

With Dialogs(wdDialogTableTableOptions)
.AllowSpacing = 0
.Execute
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top