View Single Post
 
Old 10-21-2025, 06:04 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,621
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

A bit cumbersome but may work for you:

Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim strText As String
Dim lngIndex As Long
Dim oRng As Range
Dim oCol As New Collection
Dim strPosit As String
  strText = ActiveDocument.Tables(1).Cell(1, 1).Range.Text
  For lngIndex = 1 To Len(strText)
    Set oRng = ActiveDocument.Tables(1).Cell(1, 1).Range.Characters(lngIndex)
    On Error Resume Next
    strPosit = CStr(oRng.Information(wdVerticalPositionRelativeToPage))
    oCol.Add strPosit, strPosit
   Next
  MsgBox oCol.Count
lbl_Exit:
  Exit Sub
End Sub

... of course all of the text will have to be on the same page.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote