how to find the current cursor line number 
Author Message
 how to find the current cursor line number

If cursor move to any position in the Word file. How to
find the current line number?
When highlight the Word file, how to find the line number?


Sat, 24 Sep 2005 04:55:55 GMT  
 how to find the current cursor line number
Steve
Try this
MsgBox Selection.Information(wdFirstCharacterLineNumber)

HTH
Terry V

Quote:
> If cursor move to any position in the Word file. How to
> find the current line number?
> When highlight the Word file, how to find the line number?



Sat, 24 Sep 2005 09:11:16 GMT  
 how to find the current cursor line number
without msgbox
ThisDocument.Range (wdFirstCharacterLineNumber)
But this will give you the line number from the top of the current page.

HTH
Terry V

Quote:
> Steve
> Try this
> MsgBox Selection.Information(wdFirstCharacterLineNumber)

> HTH
> Terry V


> > If cursor move to any position in the Word file. How to
> > find the current line number?
> > When highlight the Word file, how to find the line number?



Sat, 24 Sep 2005 09:17:39 GMT  
 how to find the current cursor line number

I have called:
Selection.Information(wdFirstCharacterLineNumber)

return -1 for line number.

I have set Pagination to TRUE and Pagination to FALSE. But
I still get -1 for line number.
What's the problems?

Quote:
>-----Original Message-----
>without msgbox
>ThisDocument.Range (wdFirstCharacterLineNumber)
>But this will give you the line number from the top of
the current page.

>HTH
>Terry V


>> Steve
>> Try this
>> MsgBox Selection.Information(wdFirstCharacterLineNumber)

>> HTH
>> Terry V


>> > If cursor move to any position in the Word file. How
to
>> > find the current line number?
>> > When highlight the Word file, how to find the line
number?

>.



Sun, 25 Sep 2005 12:40:29 GMT  
 how to find the current cursor line number

Quote:

>I have called:
>Selection.Information(wdFirstCharacterLineNumber)

>return -1 for line number.

it works only in layout-view.

if you work with xp sometimes it doesn't work there, but if you change
to normal-view and then back , it will work again



Mon, 26 Sep 2005 18:05:35 GMT  
 how to find the current cursor line number
Im not sure why it is not updating going from one view to another, but try
using the Application.ScreenRefresh after your code.(before end sub of
course)

HTH


Quote:

> >I have called:
> >Selection.Information(wdFirstCharacterLineNumber)

> >return -1 for line number.

> it works only in layout-view.

> if you work with xp sometimes it doesn't work there, but if you change
> to normal-view and then back , it will work again



Tue, 27 Sep 2005 03:45:32 GMT  
 how to find the current cursor line number
On Thu, 10 Apr 2003 19:45:32 GMT, "Terry VanDuzee"

Quote:

>Im not sure why it is not updating going from one view to another, but try
>using the Application.ScreenRefresh after your code.(before end sub of
>course)

there is a misunderstandung: when i open a document in PrintLayout and
run my vba-code I get in 80% of the time no lineNo. , therefore my
VBA-Code is changing to normal and back.

BTW: has somebody an answer why
Selection.Information(wdFirstCharacterLineNumber) is changing the the
line number in the middle of the line when a picture exists in the
line?

I have a one page example available, who needs an example.

MW



Tue, 27 Sep 2005 16:20:46 GMT  
 how to find the current cursor line number
I have tried Application.ScreenRefresh. It doen't work in
Web layout view.
Anyone has any ideal to get current line number under Web
layout view?

steve

Quote:
>-----Original Message-----
>On Thu, 10 Apr 2003 19:45:32 GMT, "Terry VanDuzee"

>>Im not sure why it is not updating going from one view
to another, but try
>>using the Application.ScreenRefresh after your code.
(before end sub of
>>course)

>there is a misunderstandung: when i open a document in
PrintLayout and
>run my vba-code I get in 80% of the time no lineNo. ,
therefore my
>VBA-Code is changing to normal and back.

>BTW: has somebody an answer why
>Selection.Information(wdFirstCharacterLineNumber) is
changing the the
>line number in the middle of the line when a picture
exists in the
>line?

>I have a one page example available, who needs an example.

>MW
>.



Wed, 28 Sep 2005 03:02:50 GMT  
 how to find the current cursor line number


Quote:
>I have tried Application.ScreenRefresh. It doen't work in
>Web layout view.
>Anyone has any ideal to get current line number under Web
>layout view?

As I know: never
It doesnt make sense, because the line break is dependent of the
window size


Wed, 28 Sep 2005 19:35:27 GMT  
 how to find the current cursor line number
Hi Terry,

Sometimes, I got wrong value, such as -1. From help file -
"If the Pagination property is False or the Draft property
is True, returns  - 1."
Any easy way to reset all these setting?
Thanks.

steve

Quote:
>-----Original Message-----
>Steve
>Try this
>MsgBox Selection.Information(wdFirstCharacterLineNumber)

>HTH
>Terry V


>> If cursor move to any position in the Word file. How to
>> find the current line number?
>> When highlight the Word file, how to find the line
number?

>.



Sun, 25 Sep 2005 09:32:53 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Finding current line number in Access 97 module

2. finding line number cursor is in multiline textbox

3. Return sentence index number from current cursor position

4. Find current cursor position in Word problem

5. Current Line Number in an Access Module

6. Number of current 'line' (para)

7. Current Line Number

8. Current line number

9. Current number of lines visible in RichTextBox????

10. Return Current Caret Line Number

11. Determine current line number in textarea

12. Current line number in a RichTextBox.

 

 
Powered by phpBB® Forum Software