Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

This class is used to get and set document protection settings for a document.

Signature
C#C#
Wiki Markup
{description}
{excerpt}This class is used to get and set document protection settings for a document.{excerpt}
{signature:C#}
 public sealed class DocumentProtection
Signature
{signature}{signature:vb.net
vb.net
}
Public NotInheritable Class DocumentProtection
Remarks

You cannot create a DocumentProtection object using the new keyword. You must get an existing DocumentProtection object from a Document.

MS Word equivalent: Tools menu > Protect Document...

The following sample gets the DocumentProtection object of a document so you can start working with these properties.

{signature}
{remarks}You cannot create a [DocumentProtection|DocumentProtection] object using the {{new}} keyword. You must get an existing {{DocumentProtection}} object from a [Document|Document].

MS Word equivalent: Tools menu > Protect Document...

The following sample gets the {{DocumentProtection}} object of a document so you can start working with these properties.

{remarks}
{example}{code:csharp|title=C#}

          WordApplication app = new WordApplication();
          Document doc = app.Create();
          DocumentProtection docProtect = doc.DocumentProtection;
        
{code}
{code:vb.net
|title=vb.net
}

          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim docProtect As DocumentProtection = doc.DocumentProtection
        
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Properties

...

Name

...

Description

...

AnnotationsLocked

...

{code}

{example}
{properties}
||Name||Description||
|[AnnotationsLocked|DocumentProtection.AnnotationsLocked]|{excerpt-include:DocumentProtection.AnnotationsLocked

...

AutoFormatOverride

|nopanel=true}|
|[AutoFormatOverride|DocumentProtection.AutoFormatOverride]|{excerpt-include

...

:DocumentProtection.AutoFormatOverride

...

DocumentProtected

|nopanel=true}|
|[DocumentProtected|DocumentProtection.DocumentProtected]|{excerpt-include

...

:DocumentProtection.DocumentProtected

...

EnforceDocumentProtection

|nopanel=true}|
|[EnforceDocumentProtection|DocumentProtection.EnforceDocumentProtection]|{excerpt-include

...

:DocumentProtection.EnforceDocumentProtection

...

SelectOnlyFormFields

|nopanel=true}|
|[SelectOnlyFormFields|DocumentProtection.SelectOnlyFormFields]|{excerpt-include

...

:DocumentProtection.SelectOnlyFormFields

...

StylesLocked

|nopanel=true}|
|[StylesLocked|DocumentProtection.StylesLocked]|{excerpt-include

...

:DocumentProtection.StylesLocked

...

Classes

...

Name

...

Description

...

ProtectionLevel

...

|nopanel=true}|
{classes}
||Name||Description||
|[ProtectionLevel|DocumentProtection.ProtectionLevel]|{excerpt-include:DocumentProtection.ProtectionLevel|nopanel=true}|