Question

Is that possible to get the words count from the MS Word without the carriage return and hidden text in c#.. I want to get the words count which is shown in Ms word document.. i am using Microsoft.Office.Interop.Word namespace and Using ActiveDocument.Words.Count.. i am getting all the count including the carriage return.. How to get that word count without carriage and hidden text..

Was it helpful?

Solution

This code works..

int stWordCount = wordobj.ActiveDocument.ComputeStatistics(Word.WdStatistic.wdStatisticWords);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top