|
-
Dec 29th, 2008, 12:57 PM
#1
[2005] Word Count Software/API
Anyone have any experience with using any word count software - such as Practicount?
I'm looking for an API that will do counts of words in a .DOC file.
-
Dec 31st, 2008, 09:41 AM
#2
Re: [2005] Word Count Software/API
Would something like this work for you?
vb.net Code:
Public Class Form1
Private WordApp As New Word.ApplicationClass()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyDoc As Word.Document = WordApp.Documents.Open("c:\szlamany.doc")
Dim DocumentWordCount As Integer = DirectCast(MyDoc.Range.ComputeStatistics(Word.WdStatistic.wdStatisticWords), Integer)
MessageBox.Show(DocumentWordCount.ToString)
MyDoc.Close()
End Sub
End Class
-
Dec 31st, 2008, 09:43 AM
#3
Re: [2005] Word Count Software/API
Unfortunately the customer tells me WORD is not accurate - especially with some languages.
I tried to contact PRACTICOUNT - and no one answers my e-mails...
-
Dec 31st, 2008, 09:47 AM
#4
Re: [2005] Word Count Software/API
Tell your customer that using
Code:
MyDoc.Words.Count.ToString
is not accurate, but, the computestatistics is accurate.
Test it for yourself.
Open a word document and do tools/Word Count so you know what it should be.
Now run that code, first with MyDoc.Words.Count.ToString and next with
Dim DocumentWordCount As Integer = DirectCast(MyDoc.Range.ComputeStatistics(Word.WdStatistic.wdStatisticWords), Integer)
The latter will be right on the money.
-
Dec 31st, 2008, 10:08 AM
#5
Re: [2005] Word Count Software/API
I guess these products like PractiCount see words that WORD does not - like in table and even in some kinds of images. And these word's need to be counted as well.
They currently use PractiCount - but through the PractiCount UI - we are trying to integrate our new tracking software with the document folders and do our word counting through an API to a product.
And of course the product cannot be WORD - they have expectations of performance that match these other products...
-
May 16th, 2013, 04:11 AM
#6
New Member
Re: [2005] Word Count Software/API
Hi,
did you find out the solution of counting the words?
Thanks,
Juraj
 Originally Posted by Hack
Would something like this work for you?
vb.net Code:
Public Class Form1
Private WordApp As New Word.ApplicationClass()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyDoc As Word.Document = WordApp.Documents.Open("c:\szlamany.doc")
Dim DocumentWordCount As Integer = DirectCast(MyDoc.Range.ComputeStatistics(Word.WdStatistic.wdStatisticWords), Integer)
MessageBox.Show(DocumentWordCount.ToString)
MyDoc.Close()
End Sub
End Class
-
May 16th, 2013, 04:45 AM
#7
New Member
Re: [2005] Word Count Software/API
hi, did you find some solution for counting the words? Thanks for your help.
-
May 16th, 2013, 06:02 AM
#8
Re: [2005] Word Count Software/API
No need to PM me - I prefer keep all activity on the forum itself...
No - this never got solved in a better fashion then what is discussed here.
If you are dealing with .DOCX files - they are simply ZIP files (rename it to .ZIP and you will see the "storage format" quite clearly.
Google for SPIRE.DOC and you will find some libraries you can use - they are not free though...
-
May 16th, 2013, 06:19 AM
#9
Re: [2005] Word Count Software/API
Try this:
http://pradeep1210.wordpress.com/201...erties-viewer/
It will show you a lot of information including the "Word Count". You can customize this as per your needs and remove the entries you don't want.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|