It's a bit more involved than I had hoped for - and the docs are a bit sketchy at times....
Basically, I had to enumerate the SlideIdList
on the PresentationPart
and do some XML-foo to get from that SlideId
to the actual slide in the OpenXML presentation.
Something along the lines of:
using (PresentationDocument doc = PresentationDocument.Open(fileName, false))
{
// Get the presentation part of the document.
PresentationPart presentationPart = doc.PresentationPart;
// get the SlideIdList
var items = presentationPart.Presentation.SlideIdList;
// enumerate over that list
foreach (SlideId item in items)
{
// get the "Part" by its "RelationshipId"
var part = presentationPart.GetPartById(item.RelationshipId);
// this part is really a "SlidePart" and from there, we can get at the actual "Slide"
var slide = (part as SlidePart).Slide;
// do more stuff with your slides here!
}
}