0

Dear Friends,

Am new to vb.net environment. i need to display the number of lines in word file using vb.net..please can anyone help me with this. any code will be appreciated..

Thanks and Regards,
Jayaprakash

3
Contributors
4
Replies
6
Views
9 Years
Discussion Span
Last Post by jaiprakash15
0

you could use the streamreader.Readline() and you must declare a variable of value Integer. After declaration make a loop until the End Of File is reached, and for each line that read then plus 1 to the value of the counter.

Hope i helped,
Alex

sr = Streamreader
Example:

While (End of File is reached)
sr.Readline()
counter += 1
End While
0

Will this Work on MsWord..I need to Count The No of Pages and Line in a MsWord File

0

Hmmm...

dim objWord
dim myDoc
Set objWord = New Word.Application
Set myDoc = objWord.Documents.Add("filename")
msgbox myDoc.BuiltInDocumentProperties("NUMBER OF LINES").Value

If The Above Doesn't Work, It Might Be:

msgbox objWord.BuiltInDocumentProperties("NUMBER OF LINES").Value
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.