0

I am I am trying to import PowerPoint slide design from one ppt to another. While I am able to do that successfully by using Activepresentation.applytemplate, but the problem is when I import the template the design gets applied to the entire presentation.

What i want to do, just import or copy the design from source to destination but not apply. Please advise. Thank you.

Please find the code below

Sub ImportTemplate()

ActivePresentation.ApplyTemplate "Source Template Path"

End Sub

This imports the template but at the same time applies to the slides also. But I just want to import, not apply.

QHarr
  • 83,427
  • 12
  • 54
  • 101
Anurag Pattanayak
  • 97
  • 1
  • 3
  • 13
  • @QHarr Please find the code below Sub ImportTemplate ActivePresentation.ApplyTemplate "Source Template Path" End Sub This imports the template but at the same time applies to the slides also. But I just want to import, not apply. – Anurag Pattanayak Apr 06 '18 at 07:55
  • Sorry, not sure why the formatting not working – Anurag Pattanayak Apr 06 '18 at 07:57
  • 1
    @QHarr I have updated my question, but I am using my mobile to post this, so unable to mark it as code. I have tried my best here. Thank you – Anurag Pattanayak Apr 06 '18 at 08:00
  • If you import it what do you intend to do with? If it is a template it is already available via that path. Surely you would only be bringing it in, in order to apply? Have I missed something? – QHarr Apr 06 '18 at 08:03
  • @QHarr I want to import the master slide design to my powerpoint and apply the layout to specific slides only. But if I import as I mentioned above, the moment I import, it's gets applied to the entire ppt. Which I don't want – Anurag Pattanayak Apr 06 '18 at 08:07
  • Sounds like you are after .CustomLayout for the slide maybe via ActivePresentation.Designs(1).SlideMaster.CustomLayouts ..... https://stackoverflow.com/questions/9147643/how-to-apply-particular-layout-in-powerpoint-using-vba Seems a bit long winded but could hold the template in one variable and refer to its Designs Slide Master to try and set the custom layout for your activepresentation? Or see https://stackoverflow.com/questions/20997571/create-a-new-slide-in-vba-for-powerpoint-2010-with-custom-layout-using-master – QHarr Apr 06 '18 at 08:13
  • @QHarr I had tried this. Didn't work. I found the solution. But I really appreciate your help. My apology if I didn't make myself understandable. – Anurag Pattanayak Apr 06 '18 at 08:32
  • No it is fine. The links I gave above are about using Designs as you are targeting the slide rather than presentation. – QHarr Apr 06 '18 at 08:35

1 Answers1

1

Yep, found the solution.

In place of ActivePresentation.ApplyTemplate I used ActivePresentation.Designs.load this simply loaded the master design to my ppt but didn't applied to any of the slides.

Anurag Pattanayak
  • 97
  • 1
  • 3
  • 13