Free Support Forum - aspose.com

Slide Parent Property

The documentation indicates that the “Parent” property of a Slide object is the presentation (a Presentation class). However, the run-time seems to indicate that the “Parent” property of a slide is another Slide object.

Is this just a bug in the documentation?

I was doing something where I had a reference to a Slide object, but not the Presentation that the slide was part of. When I saw in the docs there was this “Parent” property, I thought it would solve the problem. I assume that there is no easy way to go from Slide->Presentation and I need to rework my code and pass a reference to the Presentation. Does that seem right?

Hi Bruce,

Thanks for your interest in Aspose.Slides.

Well, based on the information provided by you, a test was made according to our understanding using the latest Aspose.Slides for .NET 4.1.0. A presentation was created from an existing presentation through the following code:

Presentation pres = new Presentation("pres1.ppt");

Slide sld = pres.GetSlideByPosition(2);

Presentation pres1= sld.Parent;

pres1.Write("pres2.ppt");

Both the presentations are attached. If you meant something else, please let us know.

Thanks and Best Regards

My mistake. I think I was using Shape when I thought I was using Slide (they both have Parent props). So, I was taking the Parent of the Shape which is a Slide. So, to go from Shape to Presentation, I needed to use “Parent.Parent”. Sorry for the mixup.