Maintaining Custom Document Properties
Custom properties can be used to store additional information about the document in the document itself. This article explains how to load and save these properties.

Custom properties are used to store additional information in a document. 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.
In TX Text Control, these properties can be accessed and created using the User
The UserDefinedPropertyDictionary class is used with the Load
In order to access these properties when loading a document, you will have to use the LoadSettings in the Load method.
var loadedProperties;
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
TXTextControl.LoadSettings loadSettings = new TXTextControl.LoadSettings();
tx.Load(docFile, TXTextControl.StreamType.WordprocessingML, loadSettings);
if (loadSettings.UserDefinedDocumentProperties != null)
{
loadedProperties = loadSettings.UserDefinedDocumentProperties;
}
}
On saving the document, you will have to pass the dictionary using the SaveSettings in the Save method.
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings()
{
UserDefinedDocumentProperties = loadedProperties
};
tx.Save(editedFile, TXTextControl.StreamType.WordprocessingML, saveSettings);
It is important to pass these properties explicitly when saving the document. Otherwise, the properties are not maintained during the save method.
Also See
This post references the following in the documentation:
- TXText
Control. Load Settings. User Defined Document Properties Property - TXText
Control. Save Settings. User Defined Document Properties Property - TXText
Control. User Defined Property Dictionary Class
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.
- Angular
- Blazor
- React
- JavaScript
- ASP.NET MVC, ASP.NET Core, and WebForms
Related Posts
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…
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…
Document Lifecycle Optimization: Leveraging TX Text Control's Internal Format
Maintaining the integrity and functionality of documents throughout their lifecycle is paramount. TX Text Control provides a robust ecosystem that focuses on preserving documents in their internal…
Expert Implementation Services for Legacy System Modernization
We are happy to officially announce our partnership with Quality Bytes, a specialized integration company with extensive experience in modernizing legacy systems with TX Text Control technologies.
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…