Reputation: 11
I'm trying to re-make one of my documents that became corrupt, manually adding back all the different properties.
I tried this among some others I forgot.
Sub test_getProperties()
updateThisDocument.BuiltInDocumentProperties "Total Editing Time", "34500", msoPropertyTypeNumber
End Sub
and
Sub setproperties()
BuiltInDocumentProperties("Total Editing Time").Value = 34500
End Sub
and
Sub WriteDocumentProperties()
Dim objBuiltDocProp As Object
Set objBuiltDocProp = ThisWorkbook.BuiltInDocumentProperties
objBuiltDocProp("Total Editing Time") = 35000
End Sub
Which give me
'424'
Upvotes: 1
Views: 3784
Reputation: 7860
Simple rule of thumb: if a property can't be edited in the UI, it can't be edited in VBA either.
However, you can directly edit the xml. If you have 7-Zip installed you can use it to open the document archive. The file you need is app.xml
which is in the docProps
folder. You'll find a property called TotalTime
the value for which is in minutes.
Upvotes: 6