Hello.
Is there any functionality to determine, if shape is empty?
private static void Main(string[] args)
{
Presentation ppt = new Presentation();
ppt.LoadFromFile("Presentation1.pptx");
foreach (ISlide slide in ppt.Slides)
{
foreach (IAutoShape shape in slide.Shapes)
{
if (JudgeIfShapeIsEmpty(shape))
{
Console.WriteLine("The shape is empty");
}
else
{
Console.WriteLine("The shape is not empty");
}
}
}
}
private static bool JudgeIfShapeIsEmpty(IAutoShape shape)
{
foreach (TextParagraph para in shape.TextFrame.Paragraphs)
{
if (!String.IsNullOrEmpty(para.Text))
{
return false;
}
}
return true;
}