# ODT as OLE Object in ODS

This is a programmer/software developer question, I think.

I imported an ODT file into an ODS spreadsheet as an OLE object. Worked greatl! Just curious if it's possible to find the date/time the document was imported and date/time of subsequent ODT edits after importing? I'm not interested in creating a date/time macro or interested in tracking edits. Just curious if there's built-in date/time data in the script/programming used in Version 6.0.5.2. Thanks!

edit retag close merge delete

Sort by » oldest newest most voted

(I didn't understand "...in the script/programming..." in the context.)

The embedded object being a LibreOffice model has all the information the original that was imported had. Among them there is .DocumentProperties including .CreationDate (in fact:DateTime), .ModificationDate, and .UserDefinedProperties. If the object is inserted linked, the information is read from the linked file.

The hosting shape -as any object in a LibO document- is not history aware. You can use uninterpreted properties (empty strings by default) like .Name or .Title to save extra information.

===Edit1 2019-05-20 23:20 UCT+02:00===
Regarding the comment below.

The object is embedded into a shape of appropriate type which is contained in the DrawPage of the sheet.
Example code: ...

===Edit2 2019-05-21 11:20 UCT+02:00===
I had to withdraw the code. Since I finally tried it, I had to state that it didn't work the way I expected. I had trusted in wrong memories.

Correction:
As long as the OLE object is embedded as a link, the .Model gives the .URL information. You can access the linked file to get information about it as stored by the System. You also can open it in LibO with loadComponentFromURL to get its .DocumentProperties. Despite the fact that LibO always shows the current DateTime for the containing model, the ModificationDate of a document embedded as a link is not changed if no modifications were made.
If the object is actually embedded, I cannot see a way to get its separate Modification date or the like.

I would consider this to be a bug. What would @erAck think? @Mike Kaganski: Any idea?

more

Thanks for the response, Lupp! How do I access this info for the embedded OLE object? All I can currently access are the properties for the spreadsheet, not the object.

( 2019-05-13 17:48:36 +0100 )edit

If the object is actually embedded, I cannot see a way to get its separate Modification date or the like. I would consider this to be a bug.

Why? An OLE is just another object in a document, like a frame or a character. Do you expect to have separate modification dates for each and every object in the file? A document is not a full-scale filesystem, with all complexity that it could bring. Some file types may have something resembling filesystems (ZIPs/Compound Binary Files); other types haven't (FODT/RTF); and even for those that have, it's just an implementation detail.

( 2019-05-23 09:10:50 +0100 )edit

@Mike Kaganski: Thanks!
However...
I didn't talk about the OLE2Shape, but about its .EmbeddedObjectMoNewClient.Component, .EmbeddedObject.Component or .Model, and I didn't expect to get a DateTime stamp like one created for a file by the OS. My comment was on the .DocumentProperties, and I still think, the .ModificationDate could be updated when the OLE object is closed after modifications. Factually the returned values are current time, not any DateTime stored for the containing document.
...
New experiments showed additional convolution. I need to check if I can find time to continue this...
Thanks again.

( 2019-05-23 10:14:56 +0100 )edit

## Stats

Asked: 2019-05-07 18:12:16 +0100

Seen: 57 times

Last updated: May 23 '19