public static IShape FindShape(ISlide slide, string alttext)
{
// Iterating through all shapes inside the slide
for (int i = 0; i < slide.Shapes.Count; i++)
{
// If the alternative text of the slide matches with the required one then
// Return the shape
if (slide.Shapes[i].AlternativeText.CompareTo(alttext) == 0)
return slide.Shapes[i];
}
return null;
}