'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)與源文檔和服務器代碼結合使用。我們將在我們的最後詳細調查問題,並通過您的線索爲您提供更多信息。 –