Unfortunly there is no method in the PresentationDocument to get a SlidePart by slide presentation order (slide number), so I decided to do it this way:
Public Shared Function GetSlidePartBySlideNumber(ByVal presentationDoc As PresentationDocument, ByVal slideNumber As Integer) As SlidePart
Dim uri As String = String.Format("/ppt/slides/slide{0}.xml", slideNumber)
For Each part As SlidePart In presentationDoc.PresentationPart.SlideParts
If part.Uri.ToString() = uri Then
Return part
End If
Next
Return Nothing
End Function
It seemed a good way to go, but then, besides my presentation has 33 slides, the SlideParts collection only contains 28 SlideParts... But I am still able to see the slides missing using the package explorer. Any ideas?
It seems to me that the Open XML Format SDK ( DocumentFormat.OpenXml) is still very beta and not in a good shape for professional aplications. So I'm thinking to return to System.IO.Packaging.