Does anybody know how to count accurately the words in an MSWord document?
I have tried the following, which creates a doc, adds the text, and then attempts to count the words, but it always comes out too high, I think because it counts line feeds and other characters ignored if you were to open the document in Office Word and check the word count there:
Microsoft.Office.Interop.Word._Application oWord;
oWord = new Microsoft.Office.Interop.Word.Application();
oPageDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
oPageDoc.Content.Text = text;
oPageDoc.Content.Words.Count;
Any help appreciated!