View Single Post
 
Old 10-21-2025, 10:21 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,489
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Similarly:
Code:
Dim p As Single, l As Long, Rng As Range
Set Rng = Tbl.Cell(r, c).Range
With Rng
  .End = .End - 1
  p = .Characters.First.Information(wdVerticalPositionRelativeToPage): l = 1
  Do While .Words.First.Start < .Words.Last.Start
    .MoveStart wdWord, 1
    If .Characters.First.Information(wdVerticalPositionRelativeToPage) > p Then
      p = .Characters.First.Information(wdVerticalPositionRelativeToPage): l = l + 1
    End If
  Loop
End With
MsgBox l
This, too, works when the cell spans a page break.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote