Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Word count for Microsoft Word using ColdFusion

New Here ,
May 20, 2008 May 20, 2008
Is there a way to get the word count of a Microsoft Word document using Coldfusion's COM objects? At the moment I have code which converts the word document to a string then counts the words however I need a way to access the exact wordcount that is specified in the Word Document.

Thanks in advance!
TOPICS
Advanced techniques
479
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 20, 2008 May 20, 2008
LATEST
mattbrowne wrote:
> Is there a way to get the word count of a Microsoft Word document using
> Coldfusion's COM objects? At the moment I have code which converts the word
> document to a string then counts the words however I need a way to access the
> exact wordcount that is specified in the Word Document.

cf has a COM interface & cf8 has dotnet connectivity but i don't think anyone
will recommend that you install office on the server. instead you probably might
want to give POI a shot. see

http://cfsearching.blogspot.com/2008/01/ms-word-metadata-with-poi-and.html

for an example. note that you'll need to get the 3.01 *scratchpad* jar for this
from:

http://repo1.maven.org/maven2/org/apache/poi/poi-scratchpad/3.0.1-FINAL/

and either stick it on your class path or use mark's javaloader.

btw unless the user actually updates the word count you won't get anything.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources