Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2016, 03:00 AM
vanLonden vanLonden is offline Allow spacing between cells. Windows 7 32bit Allow spacing between cells. Office 2013
Novice
Allow spacing between cells.
 
Join Date: Oct 2016
Posts: 6
vanLonden is on a distinguished road
Default Allow spacing between cells.

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.
Reply With Quote
  #2  
Old 10-27-2016, 03:01 PM
Guessed's Avatar
Guessed Guessed is offline Allow spacing between cells. Windows 10 Allow spacing between cells. Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #3  
Old 10-28-2016, 03:12 AM
vanLonden vanLonden is offline Allow spacing between cells. Windows 7 32bit Allow spacing between cells. Office 2013
Novice
Allow spacing between cells.
 
Join Date: Oct 2016
Posts: 6
vanLonden is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 12-07-2016, 11:39 PM
vanLonden vanLonden is offline Allow spacing between cells. Windows 7 32bit Allow spacing between cells. Office 2013
Novice
Allow spacing between cells.
 
Join Date: Oct 2016
Posts: 6
vanLonden is on a distinguished road
Default

' This works, from a colleague:

With Dialogs(wdDialogTableTableOptions)
.AllowSpacing = 0
.Execute
End With
Reply With Quote
  #5  
Old 12-08-2016, 02:48 AM
macropod's Avatar
macropod macropod is offline Allow spacing between cells. Windows 7 64bit Allow spacing between cells. Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply



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
Allow spacing between cells. Protecting a document; allow sections to be edited - spacing in table cells when protected dwciardi Word 3 09-30-2015 01:03 PM
Allow spacing between cells. Linking cells: can sub-cells move with their master-cell when sorting? kw01 Excel 1 06-30-2015 05:02 PM
Allow spacing between cells. 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft