Horizontal position of cursor

M

Marcus Mängel

Hi,

I try to find out the horizontal position of the cursor on a page.

HP.Range.Select
Selection.MoveLeft Unit:=wdCharacter, Count:=1
X = CInt(Selection.Range.Information(wdHorizontalPositionRelativeToPage))

Unfurtunately I allways get the value "-1".
What can be done to get the correct value?

TIA

Marcus
 
H

Helmut Weber

Hi Marcus,

switch views (print, normal) and back beforehand.

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
M

Marcus Mängel

Hi Helmut,
I tried your tip and entered the following command line infront of the
others:
ActiveDocument.ActiveWindow.View = wdPrintView as well as wdNormalView

Both ways did not work.

Is there another way to figure out the horizontal position?

TIA

Marcus
 

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