Hi,
I’m using Aspose.Words to set custom properties values on a ODT file.
The custom property is showed on the document.
If I open the updated file using Libre Office Writer I can see the updated value for the property on the document.
Otherwise, if I open it using Office Word the new value is not showed (I need to select the area and then use the menu “Update Field”).
Please note that if I do the same operation using Libre Office Writer all works fine: I can see new value when I open the file using Office Word, whitout need to use “Update field” menu!
You can see as attached file my source and destination ODT files.
My code is the following.
’ Open the document
Dim opt As New Aspose.Words.LoadOptions()
opt.LoadFormat = Aspose.Words.LoadFormat.Odt
Dim doc As Aspose.Words.Document = New Aspose.Words.Document(“source.odt”, opt)
’ Update the prop
For Each p As Aspose.Words.Properties.DocumentProperty In doc.CustomDocumentProperties
If p.Name = “MyCustomProp” Then
p.Value = "Updated at " & Now.ToShortTimeString
End If
Next
’ Updates the fields
doc.UpdateFields()
’ Save as odt
doc.Save(“dest.odt”, Aspose.Words.SaveFormat.Odt)
How can I save my odt havind the property working fine with Office Word too?
Thank you for any suggest.