Products Technologies Demo Docs Blog Support Company
TX Text Control 34.0 SP1 has been released - Learn more

X14 Preview: Adding MS Word Compatible Custom Properties to Documents

Custom properties can be created to store additional information about the document in the document itself. These properties remain with a document and can be viewed by all MS Word users that open the document. Several property management servers provide data tracking capabilities to search for, sort, and track documents based on document properties. Using TX Text Control X14 (Windows Forms, WPF and ASP.NET), custom properties can be set and retrieved using the SaveSettings and LoadSettings…

X14 Preview: Adding MS Word Compatible Custom Properties to Documents

Custom properties can be created to store additional information about the document in the document itself. These properties remain with a document and can be viewed by all MS Word users that open the document. Several property management servers provide data tracking capabilities to search for, sort, and track documents based on document properties.

Using TX Text Control X14 (Windows Forms, WPF and ASP.NET), custom properties can be set and retrieved using the SaveSettings and LoadSettings parameter in the Load and Save methods.

The new class UserDefinedPropertyDictionary contains all custom properties stored in a document. Supported value types are:

  • System.String
  • System.Boolean
  • System.Int32
  • System.Double

The following sample code shows how to add new custom properties to a document:

TXTextControl.UserDefinedPropertyDictionary userSettings =
    new TXTextControl.UserDefinedPropertyDictionary();

userSettings.Add("CustomPropertyString", "Custom property string");
userSettings.Add("CustomPropertyInt32", 123);
userSettings.Add("CustomPropertyBoolTrue", true);
userSettings.Add("CustomPropertyBoolFalse", false);
userSettings.Add("CustomPropertyDouble", 123.232);

TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings() {
    UserDefinedDocumentProperties = userSettings
};

textControl1.Save("test.rtf", 
                  TXTextControl.StreamType.RichTextFormat, 
                  saveSettings);

Unlimited number of custom properties can be stored in the document formats MS Word (DOC), Office Open XML (DOCX), Rich Text Format (RTF) and the internal TX Text Control format (TX).

The following code snippet shows how to load and retrieve the custom properties stored in a document:

TXTextControl.LoadSettings loadSettings = new TXTextControl.LoadSettings();

textControl1.Load("test.rtf", 
                  TXTextControl.StreamType.RichTextFormat,
                  loadSettings);

foreach (DictionaryEntry property in loadSettings.UserDefinedDocumentProperties) {
    Console.WriteLine(property.Key + ": " + property.Value.ToString());
}

Stay tuned for more information about the upcoming release X14!

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

ASP.NET

Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.

ASP.NET Core
Angular
Blazor
JavaScript
React
  • Angular
  • Blazor
  • React
  • JavaScript
  • ASP.NET MVC, ASP.NET Core, and WebForms

Learn more Trial token Download trial

Related Posts

ASP.NETWindows FormsWPF

TX Text Control 34.0 SP1 is Now Available: What's New in the Latest Version

TX Text Control 34.0 Service Pack 1 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

Introducing TX Text Control 34.0: Your Next Leap in Document Processing.

We are happy to announce the release of TX Text Control 34.0. This version is packed with new features and enhancements that will elevate your document processing experience. This version…


ASP.NETWindows FormsWPF

Sneak Peek: TX Text Control 34.0 Coming November 2025

We are excited to announce the upcoming release of TX Text Control 34.0, scheduled for November 2025. This update brings a host of new features and improvements to enhance your document processing…


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…

Summarize this blog post with:

Share on this blog post on: