
Protect the document by specifying the protection type and the permission password using Document->Protect(Spire::Doc::ProtectionType type, LPCWSTR_S password) method. The following are the steps to restrict editing of a Word document using Spire.Doc for C++. The user can only add revision marks to the document. The user can only enter data in the form fields in the document. Modification of comments in the document is allowed. If you want to grant people permission to read your document but restrict the types of modifications that someone can make, you can protect your document with a specific protection type and a permission password. Restrict Editing of a Word Document in C++ Save the document to another Word file using Document->SaveToFile() method.ĭocument->LoadFromFile(L"C:\\Users\\Administrator\\Desktop\\sample.docx") ĭocument->SaveToFile(L"Output/Encryption.docx", FileFormat::Docx2013). Encrypt the document with a password using Document->Eencrypt(LPCWSTR_S password) method.
Load a Word document using Document->LoadFromFile() method. The following are the steps to password protect a Word document using Spire.Doc for C++. Integrate Spire.Doc for C++ in a C++ ApplicationĮncrypting a document with a password makes sure that only you and certain people can read or edit it. You can find more details by visiting the following link. Installation via NuGet is simpler and more recommended. One way is to install it through NuGet, and the other way is to download the package from our website and copy the libraries into your program. There are two ways to integrate Spire.Doc for C++ into your application. Remove Password from a Password-Protected Word Document in C++. Remove Restrictions from a Word Document in C++. Remove Editable Regions from a Word Document in C++.
Create Editable Regions in a Word Document in C++.Protect Sections of a Word Document in C++.Restrict Editing of a Word Document in C++.Password Protect a Word Document in C++.In this article, you will learn how to protect or unprotect Word documents in C++ using Spire.Doc for C++. On the contrary, when the protection is no longer required, you may need to unprotect a Word document to improve work efficiency. There are several security options in Word that you can use to protect your documents, including password protection, read-only mode, editing restrictions, and partial protection. Document security is particularly important when critical or private data is involved in a Word document.