HTML
JPG
PDF
XML
DOCX
DOCX
Unlock DOCX Files via C++
Remove protection from Word documents including DOCX file using C++ Library.
How to Remove Protection of DOCX File Using C++
In order to unlock DOCX file, we’ll use
API which is a feature-rich, powerful and easy to use document protection API for C++ platform. You can download its latest version directly, just open
package manager, search for Aspose.Words.Cpp and install. You may also use the following command from the Package Manager Console.
Aspose.Words
PM> Install-Package Aspose.Words.Cpp
Unlock DOCX via C++
You need
referenced in your project to execute the following workflow.
- Load protected document in an instance of Document class
- Call Unprotect() function to remove protection
- Save the result back in DOCX format with save() method
System Requirements
Aspose.Words for C++ supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with C++ Runtime Environment for Windows 32 bit, Windows 64 bit and Linux 64 bit.
- Aspose.Words for C++ DLL referenced in your project.
Command
// Load DOCX document
System::SharedPtr<Document> doc = System::MakeObject<Document>(u"inputFileName.docx");
// Unprotect the document
doc->Unprotect();
// Save the document
doc->Save(u"unprotected.docx");