I've attached an attachment of what my custom properties look like when I attempt to set them.
I am currently setting the properties using the code:
pres.DocumentProperties['my_prop_name"']= "property value";
But as you can see from the attachment, it is inserting the custom properties as an 'unknown' type. In the other aspose products you can specify the type of data using the function overloads,
e.g. in Excel:
oWB.Worksheets.CustomDocumentProperties.Add(Name, "property value");
I can't seem to force the document property to become a certain type, even after trying this:
switch
(Value.GetType().Name)
{
case "String":
pres.DocumentProperties[Name] = Value.ToString();
break;
case "DateTime":
pres.DocumentProperties[Name] = Convert.ToDateTime(Value);
break;
case "Int32":
pres.DocumentProperties[Name] = Convert.ToInt32(Value);
break;
case "Boolean":
pres.DocumentProperties[Name] = Convert.ToBoolean(Value);
break;
}
Anyone have any experience with getting the correct types to go into the PPT custom properties?