Specifies write protection settings for a document.
Write protection specifies whether the author has recommended that the document is to be opened as read-only and/or require a password to modify a document.
Write protection is different from document protection. Write protection is specified in Microsoft Word in the options of the Save As dialog box.
You do not create instances of this class directly. You access document protection settings via the WriteProtection property.
Shows how to protect a document with a password.
#include <Aspose.Words.Cpp/Settings/WriteProtection.h>
Inheritance diagram for Aspose::Words::Settings::WriteProtection:Public Member Functions | |
| bool | get_IsWriteProtected () |
| Returns true when a write protection password is set. More... | |
| bool | get_ReadOnlyRecommended () const |
| Specifies whether the document author has recommended that the document be opened as read-only. More... | |
| virtual const TypeInfo & | GetType () const override |
| virtual bool | Is (const TypeInfo &target) const override |
| void | set_ReadOnlyRecommended (bool value) |
| Setter for get_ReadOnlyRecommended. More... | |
| void | SetPassword (String password) |
| Sets the write protection password for the document. More... | |
| bool | ValidatePassword (String password) |
| Returns true if the specified password is the same as the write-protection password the document was protected with. If document is not write-protected with password then returns false. More... | |
Static Public Member Functions | |
| static const TypeInfo & | Type () |
| bool Aspose::Words::Settings::WriteProtection::get_IsWriteProtected | ( | ) |
Returns true when a write protection password is set.
Shows how to protect a document with a password.
| bool Aspose::Words::Settings::WriteProtection::get_ReadOnlyRecommended | ( | ) | const |
Specifies whether the document author has recommended that the document be opened as read-only.
Shows how to protect a document with a password.
|
overridevirtual |
Reimplemented from System::Object.
|
overridevirtual |
Reimplemented from System::Object.
| void Aspose::Words::Settings::WriteProtection::set_ReadOnlyRecommended | ( | bool | value | ) |
| void Aspose::Words::Settings::WriteProtection::SetPassword | ( | System::String | password | ) |
Sets the write protection password for the document.
If a password is set, Microsoft Word will require the user to enter it or open the document as read-only.
| password | The password to set. Cannot be null, but can be an empty string. |
Shows how to protect a document with a password.
|
static |
| bool Aspose::Words::Settings::WriteProtection::ValidatePassword | ( | System::String | password | ) |
Returns true if the specified password is the same as the write-protection password the document was protected with. If document is not write-protected with password then returns false.
Shows how to protect a document with a password.