Esempio n. 1
0
        public static void UnprotectDocument()
        {
            //Load the protected word file
            WordFile            wordFile = new WordFile();
            WordDocument        document = wordFile.Import(File.ReadAllBytes("Protected.docx"));
            WordDocumentBuilder builder  = new WordDocumentBuilder(document);

            //If you have own the password, you can unprotect the document with password
            //builder.Unprotect("password");
            //If you don't own the password, you can unprotect the document without password
            builder.Unprotect();

            File.WriteAllBytes("Unprotected.docx", wordFile.Export(document));
        }