Restrict Editing

This kind of protection in DOC and DOCX formats is used to prevent unintentional changes to all or part of a document.

Since this protection does not encrypt the document, malicious applications may circumvent its use (it is not intended as a security feature and may be ignored).

Following example shows how to start enforcing editing restriction protection and how to stop enforcing it.

Restrict Editing Screenshot
Upload your file (Drag file here)
using GemBox.Document;

class Program
{
    static void Main(string[] args)
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        var document = DocumentModel.Load("%InputFileName%");

        // Disallow all editing in the document (document is read-only).
        // Since password is not specified, all users can stop enforcing protection in MS Word.
        document.Protection.StartEnforcingProtection(%EditingRestrictionType%, "%Password%");

        document.Save("Restrict Editing.docx");
    }
}
Imports GemBox.Document

Module Program

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim document = DocumentModel.Load("%InputFileName%")

        ' Disallow all editing in the document (document is read-only).
        ' Since password is not specified, all users can stop enforcing protection in MS Word.
        document.Protection.StartEnforcingProtection(%EditingRestrictionType%, "%Password%")

        document.Save("Restrict Editing.docx")

    End Sub

End Module

Check next example or download examples from GitHub.