Get number of lines on a page

M

mcphc

How do I get the number of lines on the page that the cursor is currently on
in VBA?

Thanks
 
H

Helmut Weber

Hi,

Sub Test89p()
Dim rtmp As Range
Set rtmp = Selection.Bookmarks("\page").Range
MsgBox rtmp.ComputeStatistics(wdStatisticLines)
End Sub

Note that this rises error 5941, if the cursor
is at the end of doc. Sure you don't need help
to handle that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top