CreationDate Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets the file's creation date. When a document is saved and this property is null, the creation date of the embedded file is set to the creation date of the containing document.
Syntax
public DateTime? CreationDate { get; set; }Public Property CreationDate As DateTime?Examples
The following example configures a PDF attachment before embedding it in a WordprocessingML document by using EmbeddedFile.CreationDate.
EmbeddedFile embeddedFile = new("terms.pdf", @"Attachments\terms.pdf", "application/pdf");
embeddedFile.CreationDate = DateTime.Today;
if (embeddedFile.CreationDate != null)
{
Console.WriteLine("Embedded File: Creation Date is available.");
}
SaveSettings saveSettings = new() { EmbeddedFiles = new[] { embeddedFile } };
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings);Dim embeddedFile As New EmbeddedFile("terms.pdf", "Attachments\terms.pdf", "application/pdf")
embeddedFile.CreationDate = Date.Today
If embeddedFile.CreationDate IsNot Nothing Then
Console.WriteLine("Embedded File: Creation Date is available.")
End If
Dim saveSettings As New SaveSettings() With { .EmbeddedFiles = New EmbeddedFile() { embeddedFile } }
textControl.Save("contract-with-attachment.docx", StreamType.WordprocessingML, saveSettings)