Hi,
I need VBA code to determine what the line number is based on th
location of the cursor. I also need the code for determining the lin
number(s) of a bookmark. I know that I can find the character positio
with:
Selection.Range.Start
But what I need is the line number. In the normal view as you type yo
can see the current position of the cursor in Line, Column, Page #, et
on the bottom of the window. Are these values accessable in VB
anywhere?
Bra
Helmut Weber - 03 Feb 2006 20:14 GMT
Hi,
MsgBox Selection.Information(wdFirstCharacterLineNumber)
You may have to switch views beforehand, like
ActiveWindow.View = wdNormalView
ActiveWindow.View = wdPrintView
or the other way round,
as Selection.Information(wdFirstCharacterLineNumber)
may otherwise return -1.

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
bbacklin - 04 Feb 2006 01:39 GMT
Hi,
Thanks for your help. That is the solution.
Bra