private Shape RetrieveCategoryNameBox(PowerPointSlide slide) { var nameBoxCandidate = slide.GetShapesWithTypeAndRule(MsoShapeType.msoTextBox, new Regex(".+")); if (nameBoxCandidate.Count == 0) { return null; } var categoryNamePattern = new Regex(CategoryNameBoxSearchPattern); // return the first match name box return nameBoxCandidate.FirstOrDefault(x => categoryNamePattern.IsMatch(x.TextFrame.TextRange.Text)); }