how can i get protection mode?
Posted: Thu Mar 30, 2017 4:44 pm
i need to get current protection mode from a docx file.
if the file is protected with STDocProtect.FORMS then delete all comments.
but each time i execute those code it returns null.
how can i do this correctly?
if the file is protected with STDocProtect.FORMS then delete all comments.
but each time i execute those code it returns null.
- Code: Select all
public static STDocProtect getProtectionType(MainDocumentPart mdp) throws Docx4JException {
DocumentSettingsPart ds = mdp.getDocumentSettingsPart();
CTSettings cs = ds.getContents();
CTDocProtect cp = cs.getDocumentProtection();
return cp.getEdit();
}
how can i do this correctly?