![]() |
|
#1
|
|||
|
|||
|
I have a VBA-macro to modify tables. I don't know how I can switch the checkbox for spacing between cells on and off in a VBA-macro. Please help. |
|
#2
|
||||
|
||||
|
This checkbox doesn't get recorded and there isn't an obvious command to turn it on or off in the vba intellisense. The best I can come up with is to toggle the space to zero
Code:
With Selection.Tables(1)
If .Spacing = 0 Then
.Spacing = CentimetersToPoints(0.5)
Else
.Spacing = 0
End If
End With
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#3
|
|||
|
|||
|
It is not what I hoped for. I hoped that sombody knew how to switch it off. Something like .Spacing = False.
If you use spacing = 0 there are still double lines. |
|
#4
|
|||
|
|||
|
' This works, from a colleague:
With Dialogs(wdDialogTableTableOptions) .AllowSpacing = 0 .Execute End With |
|
#5
|
||||
|
||||
|
If you have a particular format or Table Style you want to apply, you could simply use the AutoFormat or Style method, as appropriate. That will override any space between cell settings. For example:
ActiveDocument.Tables(1).AutoFormat wdTableFormatNone ActiveDocument.Tables(1).AutoFormat wdTableFormatElegant ActiveDocument.Tables(1).Style = "Table Grid" ActiveDocument.Tables(1).Style = "Table Classic 1"
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help aligning data within cells in Word and a spacing issue | damefrombrum | Word | 2 | 10-29-2015 03:30 AM |
Protecting a document; allow sections to be edited - spacing in table cells when protected
|
dwciardi | Word | 3 | 09-30-2015 01:03 PM |
Linking cells: can sub-cells move with their master-cell when sorting?
|
kw01 | Excel | 1 | 06-30-2015 05:02 PM |
Code to disable spacing between cells in table properties
|
bloomhaven | Word VBA | 3 | 03-11-2015 04:08 PM |
| Copying text range of cells to different cells adds an extra line | jpb103 | Word VBA | 2 | 07-23-2014 12:22 PM |