Counting Lines

E

eltupac

I am pretty new at this, so I ask you not to laugh.
I need to count the number of lines in a word document that looks like
this:


0ADDRESS W 868543erterter 5103ertert 85
HPS0400 E 2 F120


W

0ADDRESSW 86854ertertertrt 2134ertert 85
HPS0400 E 2 F110


W

and it goes on for pages sometimes 100 pages. I need to count the
number of lines including empty lines all the way down. I have tried
EOF with no luck.

Thanks ahead.
 
J

JGM

Hi Eltupac

Do you mean you need to know the number of lines and that's it, or within a
macro you need to know the number of lines and then do something with that
number?
If the first case, you do not need a macro:
Go to the File menu, choose Properties, click on the Statistics tab, and
look for the number of line information...
If the second, try this in your code:

ActiveDocument.ComputeStatistics wdStatisticLines

HTH
Cheers!
 
H

Helmut Weber

Hi,
MsgBox ActiveDocument.ComputeStatistics(wdStatisticLines)!
But don't rely on that too much. It's tricky.
Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
Word 97, NT4.0
 
C

Clayton L. Wilson

If you don't want to count wrapped lines, you can do this:
ActiveDocument.Paragraphs.Count
 

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