View Single Post
  #10   Report Post  
Posted to microsoft.public.word.tables,microsoft.public.word.vba.general
Ed
 
Posts: n/a
Default How many lines used in a table cell?

I found it! It actually works, too - at least in Word 2000.

Sub Foo_countMyLines()

' To count lines in a table cell,
' select all text, BUT NOT the cell marker
' If the cell marker is selected and
' included in the range, the code
' returns "0" lines

Const wdStatisticLines = 1
Dim rng As Range
Set rng = Selection.Range
MsgBox "Lines: " & rng.ComputeStatistics(wdStatisticLines)

End Sub

Ed
"Jean-Guy Marcil" NoSpam@LeaveMeAlone wrote in message
...
Jezebel was telling us:
Jezebel nous racontait que :

Yes, that was about as far as I got, too. So how do you count the
lines within a table cell?



I do not think you can do it with the Line property of the Rectangle
property. In fact, a table row will count a one line in the Count property
of the Lines property, regardless of the actual number of lines in any of
the cells in that row.

I think Helmut has an elegant solution, no?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org