mferrisi
07-09-2008, 12:30 PM
Hello,
I have a template for powerpoint that contains two slides. (a .pot file) When the template was only one slide, I was able to create a new application with one slide that matched the template. Now, I want to add a second slide, and use the template that is on page two of the template file, but am having some difficulty making it work. Thank you!
Sub Chart2PPTv3()
Dim appPPT As Powerpoint.Application
Dim presPPT As Powerpoint.Presentation
Dim shtTemp As Object
Dim objShape As Shape
Dim objGShape As Shape
Set appPPT = CreateObject("Powerpoint.application")
appPPT.Visible = True
Set appPPT = New Powerpoint.Application
Set presPPT = appPPT.Presentations.Add
objPPT.ActiveWindow.ViewType = 1
PasteIntoNewSld presPPT
End Sub
Sub PasteIntoNewSld(presApp As Powerpoint.Presentation)
Const DESIGN_FULL_PATH As String = "V:\Template\PowerPoint_Template.pot"
Dim objSld As Object
Set objSld = presApp.Slides.Add( _
Index:=presApp.Slides.Count + 1, Layout:=12)
objSld.ApplyTemplate Filename:=DESIGN_FULL_PATH
I have a template for powerpoint that contains two slides. (a .pot file) When the template was only one slide, I was able to create a new application with one slide that matched the template. Now, I want to add a second slide, and use the template that is on page two of the template file, but am having some difficulty making it work. Thank you!
Sub Chart2PPTv3()
Dim appPPT As Powerpoint.Application
Dim presPPT As Powerpoint.Presentation
Dim shtTemp As Object
Dim objShape As Shape
Dim objGShape As Shape
Set appPPT = CreateObject("Powerpoint.application")
appPPT.Visible = True
Set appPPT = New Powerpoint.Application
Set presPPT = appPPT.Presentations.Add
objPPT.ActiveWindow.ViewType = 1
PasteIntoNewSld presPPT
End Sub
Sub PasteIntoNewSld(presApp As Powerpoint.Presentation)
Const DESIGN_FULL_PATH As String = "V:\Template\PowerPoint_Template.pot"
Dim objSld As Object
Set objSld = presApp.Slides.Add( _
Index:=presApp.Slides.Count + 1, Layout:=12)
objSld.ApplyTemplate Filename:=DESIGN_FULL_PATH