'BuiltInDocumentProperties.Words'属性表示Word文档中单词数的估计值。当您调用“Document.updateWordCount”方法时,Aspose.Words会更新此属性。请参阅下面的示例代码:
Document doc = new Document(getMyDir() + "in.docx");
// Update the word, character and paragraph count of the document.
doc.updateWordCount();
// Display the updated document properties.
System.out.println("Characters: " + doc.getBuiltInDocumentProperties().getCharacters());
System.out.println("Words: " + doc.getBuiltInDocumentProperties().getWords());
System.out.println("Paragraphs: " + doc.getBuiltInDocumentProperties().getParagraphs());
希望,这有助于。
此外,请确保您使用的是latest version of Aspose.Words for Java即15.7.0。
我使用Aspose作为Developer Evangelist。
嗨Awais,我已经申请aspose代码如下&我正在使用最新的单词为java 15.7.0 – JalT
我建议你请在[Aspose.Words论坛](http:// www .aspose.com/community/forums/aspose.words-product-family/75/showforum.aspx)与源文档和服务器代码结合使用。我们将在我们的最后详细调查问题,并通过您的线索为您提供更多信息。 –