none
Shift template for a presentation RRS feed

  • Question

  • Hi

    We have a VSTO-project for Powerpoint 2010 created with Visual Studio 2010.

    In this project the customer want funtionality to "convert" Powerpoint presentations from one graphical profile to another.

    The profile is maintained in a Powerpoint template (potx) with related theme.

    In our convert function we have tried <Presentation>.ApplyTemplate and  <Presentation>.ApplyTheme, but both of these only seems to mess things up regarding layouts in the presentation. The result is a mix of both presentations layouts.

    We can accomplish a correct shift manually by following these steps:

    * Open the presentation to be converted and shift to background view

    * Create a new presentation from the template with the new graphical profile and shift to background view

    * On the new presentation, click on the first slide and press CTRL + C (copy)

    * Shift to the presentation to be converted and press CTRL + V (paste)

    The layouts from the new template are now available in the converted presentation. 

    How is these steps accomplished though code (C# or VB)?

    Thanks in advance


    Best Regards Peter Karlström Midrange AB, Sweden



    • Edited by Peter Karlström Monday, December 21, 2015 6:51 PM embarrising spelling
    Friday, December 18, 2015 2:19 PM

All replies

  • Hi Peter,

    The Presentation.ApplyTemplate method applies a design template to the specified presentation. It should be work.

    >> but both of these only seems to mess things up regarding layouts in the presentation. The result is a mix of both presentations layouts.

    Please provide the detail steps and related code to reproduce that issue. You may share a sample file on the OneDrive.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 21, 2015 7:52 AM
    Moderator
  • Hi

    Below is the function we use for the shift.
    The function GetTemplate returns the filename of the template to shift to.
    ExtractDirectory(dbPath) gets the path to the applications template folder.

    Friend Sub convertDocqa8(ByVal pres As PowerPoint.Presentation)
    
        'Get the template the presentation is to be linked to
        Dim tmplName As String = GetTemplate(pres)
        Dim tmplFileName As String = ExtractDirectory(dbPath) & "\Formatmallar\" & tmplName
        If My.Computer.FileSystem.FileExists(tmplFileName) Then
            pres.ApplyTemplate(tmplFileName)                    
        Else
            WriteLogg("Presentation template is missing on the client. Template: " & tmplName & ".", 0, "convertDocqa8", loggFile)
        End If
    
    End Sub

    We are still interested in the VSTO-code to process the steps explained in the question.


    Best Regards Peter Karlström Midrange AB, Sweden

    Monday, December 21, 2015 7:00 PM
  • Hi Peter,

    I can’t reproduce that issue with ApplyTemplate method, could you share a simple sample project on the OneDrive?

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 22, 2015 1:57 AM
    Moderator
  • Hi

    This will take some time since the samples of data/presentations is company secret information.
    I will have to get OK using the customers samples in a sample application, and this will probably delay until after start January.

    Is it hard explaining how the manual steps can be executed with code, since this is my actual question?


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, December 22, 2015 3:02 PM
  • Hi Peter,

    I can’t reproduce that issue.

    Could you reproduce that issue with a simple VBA code?

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 23, 2015 1:47 AM
    Moderator
  • Hello Starain

    Can you please forget about reproducing our not working code and help us with code for the manual process which is the real question?


    Best Regards Peter Karlström Midrange AB, Sweden

    Wednesday, December 23, 2015 7:54 AM
  • Hi Peter,

    In my opinion, I think your code should work, but actual it doesn’t work for you. So we need to narrow down the issue. It would be better that you could share a sample project on the OneDrive, which could reproduce that issue.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 24, 2015 2:10 AM
    Moderator
  • Hi Starain

    Can you please explain why you refuse to answer my question?

    Since you are "trying to better understand customer views on social support experience", I would really appreciate if we could leave our not working attempt and concentrate on the core question.

    If it isn't possible to create code to accomplish the manual steps, please let me know.
    I will then speak with the customer, after the holidays, and ask them if they are willing to try another round with our original approach.

    OK?


    Best Regards Peter Karlström Midrange AB, Sweden

    Thursday, December 24, 2015 9:23 AM
  • Hi Peter,

    There is Copy method in Slide object that could copy specified slide and there are Paste and PasteSpecial methods in View object (this.Application.ActiveWindow.View) that can paste content of clipboard into the view.

    Please try it and check whether it meets your requirements.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 25, 2015 2:58 AM
    Moderator
  • Hello Starain

    Thank you.

    I will try this directly after the holidays and get back with the results.

    Have a Happy Christmas


    Best Regards Peter Karlström Midrange AB, Sweden

    Friday, December 25, 2015 11:08 AM
  • Hi Peter,

    Please post the result here after you try it.

    Merry Christmas.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 28, 2015 1:19 AM
    Moderator
  • Hello

    I finally had some time to test your proposed solution to the manual steps as requested.

    Sorry to say, this is not the correct behaviour.

    We doesn't want to copy the presentation Slide object, rather the Background Views "Slide object".

    How do we Copy the Backgrouns Views "Slide object"?


    Best Regards Peter Karlström Midrange AB, Sweden


    Tuesday, January 12, 2016 10:04 AM
  • Hi Peter,

    >> Shift to the presentation to be converted and press CTRL + V (paste)

    Do you mean it just paste style?

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 14, 2016 2:12 AM
    Moderator
  • Hello Starain

    I really don't know what CTRL + V meens when working in background view.

    If Powerpoint had "Record Macro" as Word and Excel, this has been solved long ago.

    Actually, I have a proposed solution at the customer right now, and waiting for their response. If this is an acceptable solution, I will post the code in here.


    Best Regards Peter Karlström Midrange AB, Sweden

    Thursday, January 14, 2016 7:57 AM
  • Hi Peter,

    Please post the result here after get their response.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 15, 2016 1:30 AM
    Moderator