.. highlightlang:: us .. index:: DocSetProtectionFlags .. _docsetprotectionflags: DocSetProtectionFlags ===================== .. us.tag DocSetProtectionFlags DocSet New400 :ref:`DocSetProtectionFlags` sets the password, the comment and the protection flag. .. function:: bool = DocSetProtectionFlags(hDoc, flags, ssPassword, ssComment) .. us.return **Return Value** If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0). .. us.params **Parameters** .. uparam:: hDoc Identifies the document. .. uparam:: flags The flags ``PROTECT_READ`` and ``PROTECT_WRITE`` can be OR'd. ``PROTECT_READ|PROTECT_WRITE`` protects the document against opening and modifying. .. list-table:: :header-rows: 1 * - 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. * - - .. uparam:: ssPassword *ssPassword* is the password. The password is case sensitive. The password can be an empty string. .. uparam:: ssComment *ssComment* is a comment. The comment is displayed during opening the document. .. us.example **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"); .. us.comment **Comment** UniPlot does not encrypt the document. Therefore this command does not provide a high degree of protection. .. seealso:: :ref:`overview-documents` :sub:`id-520023`