I used this code to test the documents i attached to the post, thanks for your attention
import com.aspose.words.CustomDocumentProperties;
import com.aspose.words.Document;
import com.aspose.words.DocumentProperty;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import org.apache.commons.io.FileUtils;
public class TestErrors {
public static void main(String[] args) throws Exception {
byte[] arc;
Document doc;
// The password is 12345
arc = FileUtils.readFileToByteArray(new File("test_password.docx"));
doc = new com.aspose.words.Document(new ByteArrayInputStream(arc));
// This prints false
System.out.println(doc.unprotect("12345"));
// This document uses a custom property called _Version, its type is bstr
/**
* 1380538611623
*/
arc = FileUtils.readFileToByteArray(new File("T-2013073257-00320.docx"));
doc = new com.aspose.words.Document(new ByteArrayInputStream(arc));
CustomDocumentProperties custom = doc.getCustomDocumentProperties();
Iterator iter = custom.iterator();
while(iter.hasNext()){
DocumentProperty property = (DocumentProperty) iter.next();
// The only property found is Token, the type of the property is lpwstr
System.out.println(property.getName());
}
}
}