Log in

View Full Version : [SOLVED:] Word Table Row Height



heedaf
06-02-2020, 05:14 PM
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?

heedaf
06-02-2020, 05:29 PM
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?

macropod
06-02-2020, 07:07 PM
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.

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.