![]() |
|
|
|
#1
|
|||
|
|||
|
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
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Applying a VBA code only on a selected text or range | RobertDany | Word VBA | 2 | 10-09-2021 08:31 AM |
Find and Replace Selected Text or Macro for finding selected text
|
mrplastic | Word VBA | 4 | 12-20-2019 01:25 PM |
How to count words in a text, arrange them in separate lines and put the grammar class ?
|
Marcway | Word | 6 | 12-14-2018 04:25 PM |
| Distribute text in one cell across a range of cells (overcoming selection.range.cells.count bug) | slaycock | Word VBA | 0 | 02-18-2017 07:00 AM |
Deleting lines above selected text
|
Chayes | Word VBA | 7 | 11-03-2013 03:43 PM |