4 Replies Latest reply: Feb 21, 2013 6:10 AM by PAULfQUIRKE RSS

    Applying a template in a macro for PowerPoint

    Allen Clark

      I cannot get the Apply Template to work. Any ideal what I am doing wrong?

       

      sub ExportToPowerPoint
      'Create ppt object
      Set objPPT = CreateObject("PowerPoint.Application")
      objPPT.Visible = True

      Set objPresentation = objPPT.Presentations.Add

      'Apply a template if you want one
      objPresentation.ApplyTemplate _
      ("C:\SampleTemplate.potx")

      ' Create Slides
      ' Same Slide - 2nd Slide
      Set PPSlide = objPresentation.Slides.Add(1,1)
      ActiveDocument.GetSheetObject("Slide2").CopyBitmapToClipboard
      PPSlide.Shapes.Paste

       

      end sub