Consulting

Results 1 to 3 of 3

Thread: Word Table Row Height

  1. #1
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    107
    Location

    Word Table Row Height

    I've got the following snipet of code and Word document with a table in it and I would like to know the height of the rows in the table.

    Set TblRng = rng.Next(unit:=wdTable, Count:=1)
    
    Debug.Print TblRng.Rows.Height
    I thought it worked fine at one time but now I'm geting 99999 for the height value of a row in the tables. I've tried .row(1).height and all other variations I can think of and I only get 999999. Any idea what I'm doing wrong?

  2. #2
    VBAX Contributor
    Joined
    Jun 2014
    Posts
    107
    Location
    I think the problem is the autofit default of word for a row. If I specify the size of the row height then I can get a value otherwise it outputs 99999. Is there a way to get the actual size of a row without first specifying the exact size of the row?

  3. #3
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Quote Originally Posted by heedaf View Post
    If I specify the size of the row height then I can get a value otherwise it outputs 99999.

    That indicates only that the row height has not been set - it is automatic.
    Quote Originally Posted by heedaf View Post
    Is there a way to get the actual size of a row without first specifying the exact size of the row?
    Yes, but it entails a lot of circumlocution, via testing the vertical position of both that row's last character and of the last character preceding that row, plus allowing for font sizes, paragraph before/after spacing and the like.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

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