Products Technologies Demo Docs Blog Support Company

X15: Protected Documents Explained Simply

This article explains the document protection feature in an easy to understand way.

X15: Protected Documents Explained Simply

Using TX Text Control X15, documents can be protected by restricting the formatting and editing of content. When protecting a document, it is possible to define whether the document is completely locked or formatting can be applied.

Technically, the document gets encrypted with a password. When this encrypted document is loaded, it is restricted or set to read-only. In order to edit the document, the password needs to be entered.

Document protection diagram

The following code sets the TXTextControl.TextControl.EditMode property to UsePassword which can be only combined with EditMode.ReadAndSelect using the bitwise or operator.

textControl1.EditMode = EditMode.UsePassword | EditMode.ReadAndSelect;
textControl1.Save("encrypted-document.tx", StreamType.InternalUnicodeFormat);

When the document is loaded and the EditMode property is set to Edit, a dialog box to enter a password is opened automatically:

textControl1.Load("encrypted-document.tx", StreamType.InternalUnicodeFormat);
textControl1.EditMode = EditMode.Edit;

If the entered password matches the password that has been used to encrypt the document, the document can be edited again.

Editable regions are exceptions within protected documents to provide specific users permissions to edit these regions while the rest of the document is read-only.

How these regions can be inserted and how to define the current user will be explained in one of the next blog entries. Stay tuned!

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Also See

This post references the following in the documentation:

  • TXTextControl.TextControl.EditMode Property

Windows Forms

Text Control combines the power of a reporting tool and an easy-to-use WYSIWYG word processor - fully programmable and embeddable in your Windows Forms application. TX Text Control .NET for Windows Forms is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component for Visual Studio.

See Windows Forms products

Related Posts

Windows FormsDocument ProtectionRelease

X15: Protected Documents Explained Simply - Part II

This article explains the document protection feature in an easy to understand way focused on the editable regions.


ASP.NETWindows FormsWPF

TX Text Control 33.0 SP3 is Now Available: What's New in the Latest Version

TX Text Control 33.0 Service Pack 3 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ASP.NETWindows FormsWPF

TX Text Control 33.0 SP2 is Now Available: What's New in the Latest Version

TX Text Control 33.0 Service Pack 2 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ActiveXASP.NETWindows Forms

Service Pack Releases: What's New in TX Text Control 33.0 SP1 and 32.0 SP5

TX Text Control 33.0 Service Pack 1 and TX Text Control 32.0 Service Pack 5 have been released, providing important updates and bug fixes across platforms. These service packs improve the…


ASP.NETWindows FormsWPF

The Wait is Over: TX Text Control for Linux is Officially Here

We are very excited to announce the release of TX Text Control 33.0 which includes the long awaited Linux version of TX Text Control. This version allows you to integrate TX Text Control into your…