Consulting

Results 1 to 3 of 3

Thread: Table positioning - Move With Text check box in VBA

  1. #1
    VBAX Regular jfdawson's Avatar
    Joined
    Jan 2023
    Location
    Birmingham
    Posts
    7
    Location

    Table positioning - Move With Text check box in VBA

    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

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,359
    Location
    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
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    VBAX Regular jfdawson's Avatar
    Joined
    Jan 2023
    Location
    Birmingham
    Posts
    7
    Location
    So another mystery solved! Thanks Greg.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •