Cursor position (Word)

A

APF

How can I display the measurement of the cursor's position in inches from the
left margin/left edge of the page and the number of lines down from the top
margin/edge of page in Word?
 
D

Doug Robbins - Word MVP

You can use the VBA Selection.Information method

MsgBox "The Selection is " &
Selection.Information(wdHorizontalPositionRelativeToPage)/72 & " inch from
the left edge of the page."
MsgBox "The Selection is " &
Selection.Information(wdVerticalPositionRelativeToPage)/72 & "inch from the
top of the page."

The division by 72 is to convert the result from points to inches.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
J

Jay Freedman

You could also use the PointsToInches() function so you don't have to
remember the number 72. :)

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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