Dear all,
While trying to get the word count from a document, Aspose Words returns a value different from the one displayed on Microsoft Word.
It appears that Aspose is counting all the words in the list number format as a single word.
Here is an example:
- I created a new document and added a numeric list using the option below.
- Then, I customized it by changing the number format:
- This is the final document (you can find it attached):
- Word shows 11 words:
- Aspose Words shows 5 words:
We are using Aspose.Words 25.4.0 with .NET 8. You can find below the code and document used to get the word count.
using Aspose.Words;
var license = new License();
license.SetLicense("Aspose.Total.NET.lic");
var doc = new Document(File.OpenRead(@"Sample.docx"));
doc.UpdateWordCount();
doc.UpdatePageLayout();
Console.WriteLine($"Word Count is {doc.BuiltInDocumentProperties.Words}");
Sample.docx (14.2 KB)
Best regards,
Fabiano França