none
Can I get the uncompressed contents of the current pptx file with VBscript? RRS feed

  • Question

  • Does Powerpoint create a temporary file with the uncompressed contents of the pptx file, when it opens a pptx file?

    If yes, how can I get the name and the path of the uncompressed file / floder of the active Presentation in VBscript?

    I mean, as there is the ActivePresentation.Name and ActivePresentation.Path, is there something similar for the uncompressed contents of the pptx file?

    Friday, July 8, 2011 10:12 AM

Answers

  • Hi Perifato

    I don't think you're going to be able to solve this the way you envision. No Office application "unpacks" an Office Open XML file to a temporary folder.

    If you put the binary of the file in question into a CData node of an XML file you could include it as a CustomXMLPart in the Powerpoint pptx file, yes. In the pptx file's closed state you could extract that custom xml part and write the file to a location.

    If the file is open in PowerPoint you'd have to use Presentation.CustomXMLParts of the PowerPoint object model to access the custom xml part. You could then "stream" the information in the CData node to a file on-disk.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Perifato Monday, July 11, 2011 10:13 AM
    Monday, July 11, 2011 9:52 AM
    Moderator

All replies

  • .pptx is the default PowerPoint extension; it is not compressed. Did you mean some other extension? How did you open this "compressed" presentation in the first place? Can you post the relevant piece of your VBScript?


    jmh
    Friday, July 8, 2011 1:57 PM
  • Hi,
    thank you for your prompt reply.

    I will describe in detail the problem that I encounter.
    I insert a control in a slide. One of the properties of this control is a filename.
    So, when the slide is shown in "Slide Show" mode, the control loads the respective file.
    The problem is that, as it is now, I have to specify an absolute path for that file, and what is more, if I want to "play" the presentation on another computer, I have to make sure that that file is copied exactly to the same path.

    So, I was wondering, is it possible to place that file inside the PPTX package and then get via VBScript the path that corresponds to that file? As far as I know, Open XML documents are ordinary ZIP archives that contain the package's parts, relationships, etc.
    That's is why I asked if Powerpoint decompresses the PPTX file to a temporary folder. In that case, if I could get the path to that folder, it would be easy to resolve the absolute path to that file and then pass it to the control.
    Monday, July 11, 2011 6:51 AM
  • Hi Perifato

    I don't think you're going to be able to solve this the way you envision. No Office application "unpacks" an Office Open XML file to a temporary folder.

    If you put the binary of the file in question into a CData node of an XML file you could include it as a CustomXMLPart in the Powerpoint pptx file, yes. In the pptx file's closed state you could extract that custom xml part and write the file to a location.

    If the file is open in PowerPoint you'd have to use Presentation.CustomXMLParts of the PowerPoint object model to access the custom xml part. You could then "stream" the information in the CData node to a file on-disk.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Perifato Monday, July 11, 2011 10:13 AM
    Monday, July 11, 2011 9:52 AM
    Moderator
  • Hi Cindy,

     

    thank you very much for your response.

     

    I will try to do it the way you proposed.

    Monday, July 11, 2011 10:13 AM