I'm trying to analyze an existing PowerPoint 2010 .pptx
file using the OpenXML SDK 2.0.
What I'm trying to achieve is to
- enumerate the slides in order (as they appear in the PPTX)
- extracting all textual bits from each slide
I've started and gotten so far - I can enumerate the SlideParts
from the PresentationPart
- but I cannot seem to find a way to make this an ordered enumeration - the slides are being returned in pretty much arbitrary order...
Any trick to get these slides in the order defined in the PPTX file?
using (PresentationDocument doc = PresentationDocument.Open(fileName, false))
{
// Get the presentation part of the document.
PresentationPart presentationPart = doc.PresentationPart;
foreach (var slide in presentationPart.SlideParts)
{
...
}
}
I was hoping to find something like a SlideID
or Sequence
number or something - some item or property I could use in a Linq expression like
.OrderBy(s => s.SlideID)
on that slideparts collection.