StructuredDocumentTag.FullDate does not work?

I expect the date will be update in the document by the following code, but it has no effect

var document = new Document(“D:\template.docx”);

        var sdts = document.GetChildNodes(NodeType.StructuredDocumentTag, true).ToArray();

        for (var i = 0; i < sdts.Length; i++)
        {
            var sdt = (StructuredDocumentTag) sdts[i];
            if (sdt.SdtType == SdtType.Date)
            {
                sdt.FullDate = DateTime.Now;
            }
        }

        document.Save("D:\\temp.docx");

@qingyuan.ni,

Thanks for your inquiry. We have tested the scenario with a sample document using Aspose.Words for .NET 17.7 and unable to notice any issue. If you are using some older version then please download and try latest version of Aspose.Words for .NET, it will resolve the issue. However, if the issue persists then please share your sample input document here, we will look into it and will guide you accordingly.

Best Regards,

my document:test.zip (51.2 KB)

i think the result document shoud be like image.png (593 Bytes)

but it remians no changes.

@qingyuan.ni

Thanks for your sharing additional information. We have tested the scenario and noticed that Date is not being updated using FullDate property. We have logged a ticket WORDSNET-15651 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

However you may use following workaround to accomplish the task.

Document document = new Document("test.docx");
var sdts = document.GetChildNodes(NodeType.StructuredDocumentTag, true).ToArray();

for (var i = 0; i < sdts.Length; i++)
{
    var sdt = (StructuredDocumentTag)sdts[i];
    if (sdt.SdtType == SdtType.Date)
    {
        sdt.DateDisplayFormat = "MM/dd/yyyy";
        sdt.DateStorageFormat = SdtDateStorageFormat.Date;
        sdt.RemoveAllChildren();
        Run run = new Run(document);
        run.Text="17/07/2017";
        Paragraph para = new Paragraph(document);
        para.AppendChild(run);
        sdt.AppendChild(para);

    }
}
document.Save("dtout.docx");

Best Regards,

@qingyuan.ni,

The issues you have found earlier (filed as WORDSNET-15651) have been fixed in this Aspose.Words for .NET 17.9 update and this Aspose.Words for Java 17.9 update.