none
PPT2013: Default file format after Presentations.Open RRS feed

  • Question

  • Hi,

    I create a new presentation based on a pot/potx template via PPT2013 macro: 

    Application.Presentations.Open("templ.potx",,msoTrue)

    Note: the 3rd parameter ("Untitled") is set to msoTrue to create a new presentation file instead of open the template itself.

    Afterwards I save the created presentation by "Save as" of PPT UI Backstage/Ribbon. I would expect the default file format as defined in PPT save options (e.g. to save as a new presentation *.pptx) , but PPT2013 sets the "file type" of FileSaveDialog to "potx" (same extension as the FileName parameter of "Open").

    PPT2007 and PPT2010 run as expected. PPT2013 runs as expected as well if I create a new presentation via user interface (e.g. by double clicking the template (pot/potx) file on file explorer).

    Any idea if I do sth wrong? Is this a known PPT2013 bug?

    Possible workaround: Is there a way to set the presentation file format for unsaved files without calling the Presentation.SaveAs function

    Many thanks,

    Andreas

    Monday, December 3, 2012 1:02 PM

Answers

  • Hi Sharon,

    I started a Microsoft support call about this issue.

    The final result is that MS classifies this issue as a PowerPoint bug. At the moment they can not say if or when it will be solved, maybe by Hotfix (unlikely) or within next Service Pack (maybe).

    Fortunately, there is a workaround you can write instead. In my short tests the presentation is being created without any differences in comparison to the Presentation.Open statement.

    Workaround:

    Dim objPresentation as Presentation
    Set objPresentation = Presentations.Add
    objPresentation.ApplyTemplate "templ.potx"

    Many thanks for all your help

    Andreas

    • Marked as answer by Kai Möhrke Tuesday, January 29, 2013 1:38 PM
    Tuesday, January 29, 2013 1:38 PM

All replies

  • I have the same concern - this is bad...

    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, December 4, 2012 10:19 AM
    Moderator
  • Hi Andreas, Cindy,

    I can reproduce this. The behavior in PowerPoint 2013 API is different from UI operation. Internally, I report this issue. Product team will review the report, I'll then update if there's workaround.

    thanks.


    Forrest Guo | MSDN Community Support | Feedback to manager

    Tuesday, December 4, 2012 2:48 PM
    Moderator
  • Hi Forrest

    Thanks for looking at the problem. "Different from UI operation" is one thing, but this breaks backwards compatibility for no good reason that I can discern, except that someone wasn't paying attention. This is the only way to create a new presentation from a PowerPoint template. Unlike Excel or Word, the Add method has never created a new presentation based on the template file (including slides in the template and text, etc. on the slides). There's plenty of code "out there in the world" that depends on this behavior and will be broken!


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, December 4, 2012 6:00 PM
    Moderator
  • Good point, I emphasize this in the report.

    thanks.


    Forrest Guo | MSDN Community Support | Feedback to manager

    Wednesday, December 5, 2012 1:49 AM
    Moderator
  • Hi Forrest,

    have you got any feedback from Product team, yet?

    Thanks,

    Andreas

    Tuesday, December 18, 2012 9:39 AM
  • Hi Andreas,

    Thank you for reporting this!  It was reported to our product team but we typically don't receive feedback.  I tested to see if I could find a workaround but unfortunately, I wasn't able to.  The only thing I can suggest is to open up a support case with us so we can look into this further.  Sorry I couldn't help!


    Sharon M, Microsoft Online Community Support

    Friday, January 11, 2013 7:18 PM
  • Hi Sharon,

    I started a Microsoft support call about this issue.

    The final result is that MS classifies this issue as a PowerPoint bug. At the moment they can not say if or when it will be solved, maybe by Hotfix (unlikely) or within next Service Pack (maybe).

    Fortunately, there is a workaround you can write instead. In my short tests the presentation is being created without any differences in comparison to the Presentation.Open statement.

    Workaround:

    Dim objPresentation as Presentation
    Set objPresentation = Presentations.Add
    objPresentation.ApplyTemplate "templ.potx"

    Many thanks for all your help

    Andreas

    • Marked as answer by Kai Möhrke Tuesday, January 29, 2013 1:38 PM
    Tuesday, January 29, 2013 1:38 PM
  • Hi All,

    I completely echo Cindy's comments above.

    I only found this post after I had posted here: http://answers.microsoft.com/en-us/office/forum/office_2013_release-customize/vba-for-new-presentation-from-template-in-2013/e8ebdb6a-5e3e-4e13-a7b5-aa4656f0773c.

    There I received an alternative work-around from Shyam using the Shell function:

    Private Declare Function ShellExecute _
                    Lib "shell32.dll" _
                    Alias "ShellExecuteA" (ByVal hwnd As Long, _
                                            ByVal lpOperation As String, _
                                            ByVal lpFile As String, _
                                            ByVal lpParameters As String, _
                                            ByVal lpDirectory As String, _
                                            ByVal nShowCmd As Long) As Long
     
    Sub Test()
        Call ShellExecute(0, "New", ""C:\Users\xx\AppData\Roaming\Microsoft\Templates\My Template.potx", "", "", 1)
    End Sub

    This works better for me since than using .ApplyTemplate because my template has A4 sized slides, but the default blank is widescreen.   When you .ApplyTemplate, it messes up the template (stretching images, etc.).  Thought I'd share it here to.

    Fingers crossed MS gets this fixed soon!

    Cheers
    Rich

    Tuesday, August 13, 2013 10:25 PM