DocSetProtectionFlags¶
DocSetProtectionFlags sets the password, the comment and the protection flag.
-
bool = DocSetProtectionFlags(hDoc, flags, ssPassword, ssComment)
Return Value
If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0).
Parameters
-
hDoc
Identifies the document.
-
flags
The flags
PROTECT_READ
andPROTECT_WRITE
can be OR’d.PROTECT_READ|PROTECT_WRITE
protects the document against opening and modifying.
value | meaning |
---|---|
PROTECT_NONE (0) | No Protection. |
PROTECT_READ (1) | File open protection. UniPlot requires the user to enter a password to open the document. |
PROTECT_WRITE (2) | File modify protection. |
-
ssPassword
ssPassword is the password. The password is case sensitive. The password can be an empty string.
-
ssComment
ssComment is a comment. The comment is displayed during opening the document.
Example
hDocTemplate = DocCreate(GetRootDirectory() + "/template/template-de.ipz", 3);
hDocNew = DocCreate();
DocCopyPage(hDocTemplate, 4, hDocNew);
DocSetProtectionFlags(hDocNew, PROTECT_READ, "hallo", "hallo");
DocSave(hDocNew, "d:/test.ipw");
DocDestroy(hDocTemplate);
DocDestroy(hDocNew);
hDoc = DocCreate("d:/test.ipw", 0, "hallo");
Comment
UniPlot does not encrypt the document. Therefore this command does not provide a high degree of protection.
See also
id-520023