Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Few Question about Line Numbers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
VBALover - 16 Aug 2005 17:54 GMT
Hi all,

how can I find
1) current line numbers?

2) total line numers?

Thanks

Regards
Cindy M  -WordMVP- - 19 Aug 2005 10:31 GMT
Hi VBALover,

> how can I find
> 1) current line numbers?
>  
I think the Information property for Selection or Range
will give you this

> 2) total line numers?

I'm not sure you can get this, however. From
ComputeStatistics you can get the total number of lines,
but that may differ from what you're after...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
Klaus Linke - 19 Aug 2005 11:51 GMT
Hi VBALover,

1)
For the current line number at the start of the selection (line on the page,
as displayed in the status bar):
? Selection.Information(wdFirstCharacterLineNumber)

If you show line numbers on the page, it may be difficult to find the line
number that's actually displayed, since line numbers can be restarted on
each page, at section breaks, or they can be continuous. Also, line
numbering can be suppressed for some section, or for some paragraphs, or
paragraph styles.

2)
? ActiveDocument.Range(0,Selection.End).ComputeStatistics(wdStatisticLines)
would give you a running total up to the end of the current selection,
and
? ActiveDocument.Content.ComputeStatistics(wdStatisticLines)
the total for the main document (without text boxes, footnotes, comments,
headers and footers).

Regards,
Klaus

> Hi all,
>
[quoted text clipped - 6 lines]
>
> Regards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.