Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

no spacing between cells in table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lisa - 03 Feb 2007 15:11 GMT
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"?
Lene Fredborg - 03 Feb 2007 17:13 GMT
See this article - it suggests two workarounds to the problem:
http://word.mvps.org/faqs/macrosvba/TableSpacingOff.htm

Signature

Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word

> 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
[quoted text clipped - 17 lines]
> Is there a way I can use VBA to essentially say "Allow spacing between cells
> = False"?
Lisa - 03 Feb 2007 19:45 GMT
Lovely. Thanks much!

> See this article - it suggests two workarounds to the problem:
> http://word.mvps.org/faqs/macrosvba/TableSpacingOff.htm
[quoted text clipped - 20 lines]
> > Is there a way I can use VBA to essentially say "Allow spacing between cells
> > = False"?
Lisa - 04 Feb 2007 15:21 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.