Hi Team,
I’m using Aspose.Slides 21.1. when cleaning the PPT file metadata i’m getting issue for “LastSavedTime”.
attached the code base. please suggest.
aspose slide code.zip (631 Bytes)
Hi Team,
I’m using Aspose.Slides 21.1. when cleaning the PPT file metadata i’m getting issue for “LastSavedTime”.
attached the code base. please suggest.
aspose slide code.zip (631 Bytes)
@NPSwaroop,
Thank you for contacting support.
I guess you encountered the following error:
System.InvalidOperationException: 'LastSavedTime can't be changed via Presentation.DocumentProperties property. This property is internally updated while IPresentation object saving process. Please use the instance of PresentationInfo class to change this value of an existing presentation. Please see the example in IPresentationInfo.UpdateDocumentProperties method summary.'
The error description speaks for itself.
To update the LastSavedTime
property, please use the following code snippet:
IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo(path);
IDocumentProperties properties = info.ReadDocumentProperties();
properties.LastSavedTime = DateTime.Now;
// or
// properties.LastSavedTime = DateTime.Now.ToUniversalTime();
info.UpdateDocumentProperties(properties);
info.WriteBindedPresentation(path);
Documents: Examine Presentation
API Reference: PresentationFactory class | IPresentationInfo interface
Hi @Andrey_Potapov,
I’ve seen the error, but when using Apose.Slides 15.7.0.0 with the same Code Base, i’m not encountering the error.
when cleaning the metadata from pptx using Apose.Slides 15.7, we’re getting aspose error, then we’re reprocessing the files for higher verison of aspose.slides 21.1, we’re getting the LastSavesTime error. please suggest.
@NPSwaroop,
To change correctly the LastSavesTime
property, I suggested the way above. Could you please clarify why it does not suit you?