Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Mar 25, 2014 3:28 pm

This is what I'm currently using

Code: Select all
public int WordCount()
        {
            try
            {
                //Sometimes throws an exception
                _document.UpdateWordCount();
            }
            catch (Exception)
            {
                return -1;
            }
           
            return _document.BuiltinDocumentProperties.WordCount;
        }


I get a fairly accurate word count but it is sometimes off by 200+ words when compared to what Ms Word reports for the same document.

I need an accurate word count for my current project.
Any help is much appreciated.
Thanks,
Clayton
I

cgeorge20067
 
Posts: 2
Joined: Fri Mar 14, 2014 7:38 pm

Wed Mar 26, 2014 2:37 am

Hello,

Thanks for your inquiry.
Could you please provide us the document could reproduce the issue if convenience? It would be helpful to work out the solution for you ASAP.
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.Doc