Checking a shape for its type

Hi

I am iterating through a collection of shapes and want to check each shape to see if it is a table.

I am trying…

if (((IAutoShape)shape).ShapeType == AutoShapeType.???????)

But I am not getting an option for “Table”.

Please help.

Jason

Hi Jason,

Thank you for your interest in Aspose.Slides.

I have observed your comments and like to request you to please try using below sample code on your end to serve the purpose.

Presentation pres = new Presentation(@"D:\Test.pptx");

foreach (ISlide slide in pres.Slides)
{
    foreach (IShape shape in slide.Shapes)
    {
        if (shape is ITable)
        {
            ITable table = (Table)shape;
            //TODO code here
        }
    }
}

Please let us know if the issue persists. We will be glad to help you further.

Best Regards,