Thanks to Merit Cooper from live chat for posting this to the forum for me, just to give a little more detail here is the code snippet I am using -- my problem is when the properties object is null, my custom property is not added. When the last two lines are executed it seems to work correctly.
var properties = _presentationEx.DocumentProperties;
if (properties == null)
{
properties = newDocumentPropertiesEx();
properties[fileinfo] = toString;
return;
}
I have tried to understand the code snippet shared by you. Can you please share the source presentation that you are using and that returns null object of DocumentProperties. Actually, whenever I have tried to generate the presentation from PowerPoint or by using ASpose.Slides, the DocumentProperties is never null. Please share the working code snippet to reproduce the issue on our end please as well. For your kind reference, please visit this thread link as well.