0

スライドを作成し、それぞれに大きな (数 MB サイズの) 画像を既存の .csv ファイルに挿入していpptxます。ただし、別のプレゼンテーションのレイアウトを使用したい。テンプレートからマスターをインポートすることはできますが、使用すると.ApplyTemplate("desiredTemplate"). .ppLayoutTitleOnlyしかし、パワーポイントの元のレイアウトとは対照的に、新しいスライドにインポートされたレイアウトを持たせるにはどうすればよいTitleOnlyですか?

 Private Sub PPTGeneratorAL(ByVal imageArr As List(Of String), ByVal alReportName As String)

        Const sTemplate = "C:\temp\script\testtemplate2.potx"

        Dim oApp As PowerPoint.Application
        Dim oPres As PowerPoint.Presentation
        Dim oSlide As PowerPoint.Slide
        Dim scaleFactor As Decimal

        oApp = New PowerPoint.Application()
        oApp.Visible = True
        oApp.WindowState = PowerPoint.PpWindowState.ppWindowMinimized

        oPres = oApp.Presentations.Open(alReportName)
        oPres.Slides.Range(2).Delete()
        oPres.Slides.Range(2).Delete()
        oPres.Slides.Range(2).ApplyTemplate(sTemplate)

      For Each slideImage In imageArr

  'this next line is the one that's not doing what I want
            oSlide = oPres.Slides.Add(3, PowerPoint.PpSlideLayout.ppLayoutTitleOnly)

           'code to add the image to the slide here - this part works

            oSlide = Nothing
      Next slideImage

end sub
4

1 に答える 1