Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selecting the Current Table

    I need to programatically move to the row 2, column 2 in the table in which the cursor is located. I can't find a way from VBA to identify the table ID for the table containing the cursor. How can I obtain this bit of information?

    Thanks.

  2. #2
    New Lounger
    Join Date
    Mar 2001
    Location
    Leeds, UK
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting the Current Table

    Bill

    Will this suit your purpose?

    Sub GotoRow2Col2()
    With Selection
    .Collapse wdCollapseStart
    If .Information(wdWithInTable) Then
    If .Information(wdMaximumNumberOfColumns) > 1 _
    And .Information(wdMaximumNumberOfRows) > 1 Then
    .Tables(1).Cell(2, 2).Select
    .Collapse wdCollapseStart
    End If
    End If
    End With
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting the Current Table

    Thanks!

    After I posted this I discovered that using Selection.Tables.Count always produces 1. This was throwing me at first, but a little thought brought me to code close to what you suggested. However, yours is much more robust in its effort to verify a table size large enough so I will be getting out my trusty clipboard and using it.

    Thanks again for the help.

Posting Permissions

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