locked
Upload .doc-file and count no. of words? RRS feed

  • Question

  • User-62417320 posted

    Hello!

    I've been searching for a while now, but i can't find an answer that really suites my needs.
    My plan is to have ha page in my asp.net (C#) project where the user can upload a .doc file, maybe also docx.
    Then i want the application to automatically extract some info from the uploaded file. The most important bit is to count the number of words of the document.
    I suppose that it's possible to retreive all the info about the document as when you right click the file and look at the properties?
    It's easier with docx, because it's based on xml, while .doc isn't, right?

    I'm clueless how to get started, so any links, hints or tips are very appreciated!

    Thanks in advance!

    Friday, October 29, 2010 5:21 PM

Answers

  • User197322208 posted

    It is about using Word to create a new document. You can use the same Word to open the file and see the number of words....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 30, 2010 2:12 PM
  • User2022958948 posted

    You can try use C# to do word count for word document after it is uploaded to the server.

    http://dotnetperls.com/word-count

    But as far as I know, no a perfect method to suit for any version of Word doc. This method is working perfect for Office Word 2007.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 8, 2010 4:05 AM

All replies

  • User197322208 posted

    If you have a server that has Word, you can automate from .NET http://support.microsoft.com/kb/316384

    If not , you have to think about word reader ( for docx is OpenXML ) .

    You can try also Aspose (paid)

    Saturday, October 30, 2010 3:43 AM
  • User-62417320 posted

    Thanks for the reply, but this solution is the other way around: http://support.microsoft.com/kb/316384. That is, creating a word document from asp.net.

    Any more ideas?

    Saturday, October 30, 2010 12:05 PM
  • User197322208 posted

    It is about using Word to create a new document. You can use the same Word to open the file and see the number of words....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 30, 2010 2:12 PM
  • User2022958948 posted

    You can try use C# to do word count for word document after it is uploaded to the server.

    http://dotnetperls.com/word-count

    But as far as I know, no a perfect method to suit for any version of Word doc. This method is working perfect for Office Word 2007.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 8, 2010 4:05 AM