A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Page Layout
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Cursor position (Word)



 
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2010, 11:53 PM posted to microsoft.public.word.pagelayout
APF
external usenet poster
 
Posts: 1
Default Cursor position (Word)

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?
  #2  
Old February 24th, 2010, 01:35 AM posted to microsoft.public.word.pagelayout
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default Cursor position (Word)

You can use the VBA Selection.Information method

MsgBox "The Selection is " &
Selection.Information(wdHorizontalPositionRelative ToPage)/72 & " inch from
the left edge of the page."
MsgBox "The Selection is " &
Selection.Information(wdVerticalPositionRelativeTo Page)/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.

"APF" wrote in message
...
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?


  #3  
Old February 24th, 2010, 02:18 AM posted to microsoft.public.word.pagelayout
Jay Freedman
external usenet poster
 
Posts: 9,488
Default Cursor position (Word)

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

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Wed, 24 Feb 2010 11:35:24 +1000, "Doug Robbins - Word MVP"
wrote:

You can use the VBA Selection.Information method

MsgBox "The Selection is " &
Selection.Information(wdHorizontalPositionRelativ eToPage)/72 & " inch from
the left edge of the page."
MsgBox "The Selection is " &
Selection.Information(wdVerticalPositionRelativeT oPage)/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.

"APF" wrote in message
...
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?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.