PDA

View Full Version : [SOLVED:] Table positioning - Move With Text check box in VBA



jfdawson
06-14-2023, 09:19 AM
I am trying to manipulate a Table in Word that spans multiple pages in the document using VBA. Manually, if I go into Table properties, positioning, and check the box "Move With Text", I can put my cursor before the Table and hit Enter to move the Table down a line on the page. I want to do this in VBA but have not found the command to essentially check that box. Any help would be appreciated!

Thanks,

jfdawson

gmaxey
06-14-2023, 09:47 AM
Sub Macro1()
'Checks
With Selection.Tables(1).Rows
.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
End With
End Sub
Sub Macro2()
'Unchecks
With Selection.Tables(1).Rows
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
End With
End Sub

jfdawson
06-14-2023, 12:22 PM
:yes So another mystery solved! Thanks Greg.