We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SaveDate field does not update when Aspose.Words saves the document

Hello,


I have noticed that Aspose.Words does not update the SaveDate field when saving the document object.

Why is this?

Thanks,
Adam

Hi Adam,


Thanks for your inquiry. Could you please attach your 1) input Word document, 2) output Word/Pdf document(s) showing the undesired behaviour and 3) code you are using to generate output document(s) here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Hi,


Input doc = Date Test.docx
Output doc(s) = generated.docx, generated.pdf

As you can see between Date Test.docx and generated.docx, there is no difference in SaveDate even though it was saved via Aspose. In generated.pdf there is no SaveDate at all.

The code i used was essentially the following:

Document oTemplate = new Document(sTemplatePath);
oTemplate.Save(@“C:\generated.docx”);

– or –

oTemplate.Save(@“C:\generated.pdf”);

Hi Adam,


Thanks for the additional information.

In your case, please explicitly update fields in the whole document by simply calling the Document.UpdateFields method before saving to PDF as follows:

Document
doc = new Document(@“C:\Temp\Date+Test.docx”);

doc.Save(@"C:\Temp\out.docx");

doc.UpdateFields();

doc.Save(@"C:\Temp\out.pdf");


I hope, this helps.

PS: We have just released Aspose.Words version 13.2.0 here; so, I would suggest you to please upgrade to the latest version of Aspose.Words.

Best regards,

But even if i do not save as .pdf and don’t execute the UpdateFields() method, the SaveDate field in the .docx is not updated.


Thanks,
Adam

Hi Adam,


Thanks for the additional information. Yes, you are right; we will consider updating SaveDate field during open/save with Aspose.Words in future. I have logged this issue in our bug tracking system as WORDSNET-7912. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

@AdamNygate,

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