Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

Sets or returns a protection level for the document. Possible values are: None, TrackChanges, Comments, Forms, and ReadOnly.

Signature
C#
C#
<table class="diff-macro"><thead><tr><th class="diff-macro-title">unmigrated-wiki-markup</th></tr></thead><tbody><tr><td class="diff-macro-body"><pre>
 public ProtectionLevel DocumentProtected{ get; set; }
</pre></td></tr></tbody></table>
Signature
vb.net
vb.net
Public <p>Public Property DocumentProtected() As ProtectionLevel</p>ProtectionLevel
Example
 
Code Block
csharp
csharp
titleC#
            //--- Get ProtectionLevel
          DocumentProtection.ProtectionLevel level = docProtect.DocumentProtected;

          //--- Set ProtectionLevel to allow editing of Forms only
          docProtect.DocumentProtected = DocumentProtection.ProtectionLevel.Comments;
        
Code Block
vb.net
vb.net
titlevb.net
            '--- Get ProtectionLevel
          Dim level As DocumentProtection.ProtectionLevel = docProtect.DocumentProtected

          '--- Set ProtectionLevel to allow editing of Forms only
          docProtect.DocumentProtected = DocumentProtection.ProtectionLevel.Comments
        
Example