pres pptx is saved and contains 4 slides that look perfect. I then create a clone in destPres. I then tried code from your online help file to move the master from pres to destPres so it would have the same styles/look and feel; however an empty slide shows up as slide 0 and the slide I tried to insert is there; however the formatting is off, looks like the master code did not work. How do I remove the dummy slide and keep the formatting from the original pres pptx ?
Dim the_path As String = Path.Combine(Request.PhysicalApplicationPath, "Files\"), iSlide As Integer = 0
'save our modified pptx
pres.Save(the_path & ApiKey & ".pptx", Export.SaveFormat.Pptx)
'based on the modified pptx clone each slide and save as new ppt's
Using presentation As New Presentation(Path.Combine(Request.PhysicalApplicationPath, "Files\" & ApiKey & ".pptx"))
Using destPres As New Presentation()
' Instantiate ISlide from the collection of slides in source presentation along with
' master slide
Dim SourceSlide As ISlide = pres.Slides(0)
Dim SourceMaster As IMasterSlide = SourceSlide.LayoutSlide.MasterSlide
' Clone the desired master slide from the source presentation to the collection of masters in the
' destination presentation
Dim masters As IMasterSlideCollection = destPres.Masters
Dim DestMaster As IMasterSlide = SourceSlide.LayoutSlide.MasterSlide
' Clone the desired master slide from the source presentation to the collection of masters in the
' destination presentation
Dim aSlide As IMasterSlide = masters.AddClone(SourceMaster)
' Clone the desired slide from the source presentation with the desired master to the end of the
' Collection of slides in the destination presentation
Dim slds As ISlideCollection = destPres.Slides
slds.AddClone(SourceSlide, aSlide, True)
' Clone the desired slide from the source presentation to the end of the collection of slides in destination presentation
'slds.AddClone(pres.Slides(0))
'remove first default slide from cloned presentation
'destPres.Slides.Remove(slds.Item(0))
' Write the destination presentation to disk
destPres.Save(the_path & ApiKey & "_" & iSlide & ".pptx", Export.SaveFormat.Pptx)
End Using
End Using