#1
|
|||
|
|||
know how to obtain the number of lines written on a given page ?
Hello,
Does anyone know how to obtain the number of lines written on a given page (numPage)? The following code only works if "numPage + 1" exists. Set startPage = ActiveDocument.GoTo(What:=wdGoToPage, Count:=numPage) Set endPage = ActiveDocument.GoTo(What:=wdGoToPage, Count:=numPage + 1) endPage.Collapse Direction:=wdCollapseEnd MsgBox ActiveDocument.Range(startPage.Start, endPage.Start).ComputeStatistics(wdStatisticLines) Thank you very much for your feedback. Yours sincerely David |
#2
|
||||
|
||||
There is a special bookmark to work with a range (or select) for a full page
Code:
Sub GetLines() Dim rng As Range Set rng = ActiveDocument.GoTo(What:=wdGoToPage, Count:=3) Set rng = rng.GoTo(What:=wdGoToBookmark, Name:="\page") MsgBox rng.ComputeStatistics(wdStatisticLines) End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Thanks a lot Guessed, it works great!
Have a nice day, David |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help making legal line number stay at 25 lines a page when I have sections with single spaced text | LegalTranscriber2017 | Word | 5 | 07-16-2022 06:50 PM |
Moving hand written note from one page to another - or another notebook | justpk | OneNote | 1 | 05-05-2019 05:55 PM |
Grouping Lines by Project number on a separate page | taholmes160 | Excel | 2 | 04-17-2019 03:57 AM |
Customizing number of lines per page | Word Rox | Word | 1 | 04-05-2015 07:28 PM |
Number of lines on page problem | JamesT | Word | 0 | 08-27-2009 04:52 PM |