Jay Freedman was telling us:
Jay Freedman nous racontait que :
It's worse than that: If the row height isn't specified in the Table >
Table Properties > Row dialog, then the row's .Height property will
return a value of 9999999 (which is the constant wdUndefined). If that
happens, the only way remaining is to get the property
.Information(wdVerticalPositionRelativeToPage) for the current row's
range, get the same property for the next row's range, and take the
difference (checking first that they aren't on different pages).
The code for the general case is quite a mess.
Right, had forgotten about that.
In that case, if there aren't any merged cells, we can use this workaround:
'_______________________________________
Sub GetRowHeight()
Dim lngRowHeightType As Long
Dim sngRowHeight As Single
Dim tblTarget As Table
Set tblTarget = ActiveDocument.Tables(1)
With tblTarget.Rows(5)
'Get Height
If .Height = wdUndefined Then
'Save current setting
lngRowHeightType = .HeightRule
.HeightRule = wdRowHeightExactly
sngRowHeight = .Height
.HeightRule = lngRowHeightType
Else
sngRowHeight = .Height
End If
MsgBox Format(PointsToInches(sngRowHeight), "#0.00") & " inches tall"
End With
End Sub
'_______________________________________
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org