Welcome to OpenXML Developer Sign in | Join | Help

Slides Missing at the PresentationPart.SlideParts

Last post 09-12-2008, 11:28 AM by Paulo. 3 replies.
Sort Posts: Previous Next
  •  07-10-2008, 2:09 PM 3455

    Slides Missing at the PresentationPart.SlideParts

    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.

  •  07-15-2008, 8:38 AM 3474 in reply to 3455

    Re: Slides Missing at the PresentationPart.SlideParts

    Ok, I understand what was the problem, the slides that are missing at the SlideParts list have the same relationship id that other parts in the package:
    rId2 - docProps\thumbnail.jpeg
    rId2 - slides\slide1.xml

    It works fine when using the System.IO.Packaging because it only uses the uris and they are unique.

    This presentation was created with PowerPoint 2000 sp3 and then converted to pptx using PowerPoint 2007, anyway, it seems that is a bug in DocumentFormat.OpenXml that needs to be fixed.

  •  09-12-2008, 11:10 AM 3690 in reply to 3474

    Re: Slides Missing at the PresentationPart.SlideParts

    Moreover the slide3.xml cannot be the 3rd slide in the presentation. It could be 33rd slide in your presenation. So we can't get the slide number based on the slide{0}.xml file.
  •  09-12-2008, 11:28 AM 3691 in reply to 3690

    Re: Slides Missing at the PresentationPart.SlideParts

    No, the problem is that the presentationDoc.PresentationPart.SlideParts doesn't contain slides witch the relation ids are duplicated in the package for other parts like images.
View as RSS news feed in XML