TX Text Control .NET for Windows Forms

LastModificationDate Property

Property|Introduced in 29.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets the date the file was last modified. When a document is saved and this property is null, the modification date of the embedded file is set to the modification date of the containing document.

Syntax

public DateTime? LastModificationDate { get; set; }

Examples

The following example configures a PDF attachment before embedding it in a WordprocessingML document by using EmbeddedFile.LastModificationDate.

EmbeddedFile embeddedFile = new("terms.pdf", @"Attachments\terms.pdf", "application/pdf");

embeddedFile.LastModificationDate = DateTime.Today;
if (embeddedFile.LastModificationDate != null)
{
    Console.WriteLine("Embedded File: Last Modification Date is available.");
}

SaveSettings saveSettings = new() { EmbeddedFiles = new[] { embeddedFile } };
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings);