Problem with issue 26968

Hi,

I am having trouble setting new DocumentPropertiesEx on powerpoint files using Slides.

I have seen issue 26968, and it says it is resolved, but it doesnt seem to be working for me.

basically, if this line returns null:

var properties = _presentationEx.DocumentProperties;

then no properties are added.
If it does return an object, my adds are successful.

here is the code i am using when that line returns null:

properties = new DocumentPropertiesEx();
properties[fileinfo] = toString;
where fileInfo and toString are both strings i have passed in

This message was posted using Email2Forum by Merit.

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 = new DocumentPropertiesEx();
                    properties[fileinfo] = toString;
                    return;
                }
            <SPAN style="COLOR: blue">if</SPAN> (!properties.Contains(fileinfo))
                properties[fileinfo] = toString;</PRE><PRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 13px"> </PRE>

Hello Dear,

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.

Thanks and Regards,