View Single Post
 
Old 09-17-2023, 03:33 PM
eduzs eduzs is offline Windows 10 Office 2019
Expert
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default

I found a workaround that seems to work for me, by extending the selection to start of the 1st line and to the end of the last line before retrieve the selection lines count.
Code:
With Selection
    .StartOf Unit:=wdLine, Extend:=wdExtend
    .EndOf Unit:=wdLine, Extend:=wdExtend
    iLins = .Range.ComputeStatistics(wdStatisticLines)
End With
__________________
Backup your original file before doing any modification.
Reply With Quote