Format of bin files in Powerpoint files RRS feed

  • Question

  • Hi,

    I am trying to generate a pptm file programatically .

    This file should have a control (commandButton) with a macro attached to it.

    I 've seen that the file generated by Powerpoint contains a vbaProject.bin file.

    This file is in binary format. Is this format open or is there another way to attach a macro to a control?

    Tuesday, October 16, 2012 10:47 AM


All replies

  • Hi stkarp

    I take it you're working with the Open XML SDK or System.IO.Packaging?

    *.bin files are proprietary and cannot be generated/manipulated through the Open XML file format. Best you could do would be to copy the parts from another file into your target file.

    Note that besides the vbaProject.bin file you'd also need the activeX.bin file and the image file for the ActiveX CommandButton.

    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, October 17, 2012 2:19 PM
  • Hi Cindy,

    thank you very much for your response.

    I am using neither the Open XML SDK nor System.IO.Packaging. I have developed a custom simple PresentationML writer since I need to run the program in multiple platforms.

    I could copy those files from another file into the target file but unfortunately the macro depends on some user input. So, the bin files will not be always the same.

    But let me give you some details about what I am trying to do:  when the user presses the command button, I want to change the property of another control that lies in another slide (the value of the property depends on user input) and navigate to that slide (whose index also depends on user input). So, I thought that this could be done only by using a command button. But then I came up with the problem with bin files.

    So, do I have any other options? (if I knew what is written in the bin files then I would generate them myself. It's no problem if I can't use an SDK for that).

    Thursday, October 18, 2012 6:13 AM
  • Hi stkarp

    See if Tom Xu's answer in this thread helps

    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, October 20, 2012 6:55 AM
  • Hi Cindy,

    thank you very much for your help.

    I will check it out and I will let you know of the result.

    Tuesday, October 23, 2012 7:44 AM
  • Finally I opted for a different approach.

    I created a custom ActiveXButton that runs a vbscript when it is clicked and I insert this control in my presentation.

    (Sorry for the delayed response).

    Friday, March 1, 2013 9:39 AM