Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 5th, 2006, 02:09 PM
Authorized User
 
Join Date: Jun 2003
Location: rawalpindi, panjab, Pakistan.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arshad mahmood
Default How to count lines in ASP

Dear All

I need ASP code for counting lines in MS word file.
Can any one help me.

Regards.



arshad mahmood
__________________
arshad mahmood
Reply With Quote
  #2 (permalink)  
Old June 6th, 2006, 06:35 AM
Authorized User
 
Join Date: Feb 2006
Location: Verona, Italy, Italy.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this code !

<%
'Creazione dell'istanza FSO.
Set fsoMyFile = CreateObject("Scripting.FileSystemObject")

'Apertura del file, in lettura dati (1).
Set tsTextStream = fsoMyFile.OpenTextFile(Server.MapPath("file.doc"), 1)
conta = 0
do while not tsTextStream.AtEndOfStream
tsTextStream.ReadLine
conta = conta + 1
Loop
tsTextStream.Close
%>

The number is: <%=conta%>


Steweb




Visit my web site !
www.steweb.net
Reply With Quote
  #3 (permalink)  
Old June 6th, 2006, 03:11 PM
Authorized User
 
Join Date: Jun 2003
Location: rawalpindi, panjab, Pakistan.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arshad mahmood
Default

Dear steweb
textstream object works properly with .txt files only.
But this dose not works with .doc files.

Any way thank you.

If you have any other soloution i am waiting.

Thanks

arshad mahmood
Reply With Quote
  #4 (permalink)  
Old June 7th, 2006, 09:56 AM
Authorized User
 
Join Date: Feb 2006
Location: Verona, Italy, Italy.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes ! sorry ..is not .rtf file !

Do you have Word.Application object ?

search in google..




Visit my web site !
www.steweb.net
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
to count amount of lines in string glaudsonsilva C# 1 July 19th, 2007 03:10 PM
Need to Count number of lines in a file lawsoncobol Access VBA 2 July 19th, 2007 04:28 AM
how to count lines in word file arshad mahmood VB How-To 2 June 7th, 2006 09:40 PM
Datagrid scroll count (Lines) VB.NET 2003 peterasimpson VB How-To 1 November 24th, 2005 12:33 AM
Count the number of output lines joyces XSLT 7 July 6th, 2005 11:49 AM



All times are GMT -4. The time now is 07:07 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.