I'd very much appreciate your assistance in completing this recursive function. I am trying to go over all the content of a slide and capturing/printing its text. From my research, a slide can contain either a shape or a group. A shape can be a picture, a chart, a table, a textbox, or anything else powerpoint allows you to place. A group contains multiple shapes.
Here is what I have so far. Please complete it for me if I'm missing anything. Thank you
- Code: Select all
foreach (ISlide slide in presentation.Slides)
{
foreach (IShape ishape in slide.Shapes)
{
GetTextFromShape(ishape);
}
}
private void GetTextFromShape(IShape ishape)
{
if (ishape is GroupShape)
{
foreach (IShape ishapeInGroup in ((GroupShape)ishape).Shapes)
GetTextFromShape(ishapeInGroup);
}
else
{
if (ishape is ITable)
GetTextFromTable(ishape);
else if (ishape is IAutoShape)
GetTextFromIAutoShape(ishape);
}
}
private static void GetTextFromTable(IShape ishape)
{
//get text
}
private static void GetTextFromIAutoShape(IShape ishape)
{
//get text
}