Hi all. I’m working with Visual Studio 2003, and working in Visual Basic. For some reason, I’m having trouble duplicating one particular slide using Clone Slide. Below are the slides and the code I’m calling from an .aspx page. I’d appreciate any ideas on what could be causing this problem:
source.ppt - This 3-slide powerpoint is defined in the code, and all three slides are cloned into a new file. Slide 2 does not clone correctly though. - http://www.virtualfactory.com/source.ppt
blank.ppt - A simple 1-slide powerpoint with no contents and default settings - http://www.virtualfactory.com/blank.ppt
new.ppt - This is the result when I run it through the code below. The second slide does not come through - http://www.virtualfactory.com/new.ppt
Again, any help would really be appreciated.
Here’s the code: (also available at http://www.virtualfactory.com/cloneCode.txt
)
Imports System.Data.OleDb
Imports System.Collections
Imports Aspose.Slides
Public Class clone
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
Private Sub InitializeComponent()
End Sub
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Public Sub RunClone()
Dim SourcePresentation As Presentation = New Presentation(“D:\source.ppt”)
Dim DestPresentation As Presentation = New Presentation(“D:\blank.ppt”)
Dim sList As SortedList = New SortedList
Dim Slide1 As Slide = SourcePresentation.GetSlideByPosition(1)
Dim Slide2 As Slide = SourcePresentation.GetSlideByPosition(2)
Dim Slide3 As Slide = SourcePresentation.GetSlideByPosition(3)
SourcePresentation.CloneSlide(Slide1, DestPresentation.Slides.LastSlidePosition + 1, DestPresentation, sList)
SourcePresentation.CloneSlide(Slide2, DestPresentation.Slides.LastSlidePosition + 1, DestPresentation, sList)
SourcePresentation.CloneSlide(Slide3, DestPresentation.Slides.LastSlidePosition + 1, DestPresentation, sList)
DestPresentation.Slides.RemoveAt(0)
DestPresentation.Write(“D:\new.ppt”)
Response.Write(“Finished Processing”)
End Sub
End Class