Java: How can I check is file correct MS Word document?
How c开发者_JAVA百科an I check is file correct MS Word document by using Java? The main purpose is filter files that will be opened by MS Word with any mistake
Try a Java API for MS Office Docs.
Apache POI is a great project for reading and writing MS Word docs from Java. However, it is not MS Word. So whilst it can open a lot of Word documents, there will always be a margin for error. ie. Documents that it considers ok, but have problems when opened by Word. The only program that can accurately open and check a Word document is Word itself.
So you need to consider what you mean by opening "without any mistake". What are you actually trying to validate? and perhaps - do you really need to do this at all?
精彩评论