Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have Presentation Engine application, while downloading Power Point Presentation 2007 my performance gets down.... i am using vb.net code... while downloading suppose there are 8 slides then it copy and paste each slides and take extra time. can anyone suggest me on this.

I have following code sample:-


VB
Protected Function InsertPptSlide(ByVal mySlide As PptSlide, _
                                ByVal slideIndex As Integer) _
                                    As PowerPoint.Slide
        Dim ppPresSource As PowerPoint.Presentation
        Dim sldSource As PowerPoint.Slide 'Slide to be copy
        Dim sldInserted As PowerPoint.Slide  'slide once copied in the output presentation
        Dim sldBlankSlide As PowerPoint.Slide
        log.Debug("Entering InsertPptSlide()")

        ppPresSource = _colSourcePres.GetPresentation(mySlide.PptFileName, _presentation)

        sldSource = ppPresSource.Slides(mySlide.SlideIndex)

        If mySlide.TemplateChange Then
            'Add a blank template first to be able to apply the template before we copy the real slide
            'We need to apply the template before we copy the real slide,
            'otherwise a distortion may appear on the slide
            'like font getting reduced in table
            '(This is to fix the problem detected on July 31, 2003 by NACM)

            sldBlankSlide = _presentation.Slides.Add(slideIndex, ppLayoutBlank)

            'Apply template to the slide
            sldBlankSlide.Design = sldSource.Design

            'because we added this blank slide,
            'our slide must be inserted at the position (intIndexSlide + 1)
            slideIndex = slideIndex + 1
        End If

        'Copy from source, paste in destination
        sldSource.Copy()
      _presentation.Slides.Paste(slideIndex)

        'Get a reference on the inserted slide
        sldInserted = _presentation.Slides(slideIndex)

        If mySlide.TemplateChange Then
            'Delete the blank slide that we used to apply the template
            sldBlankSlide.Delete()
        End If

        sldInserted.ColorScheme = sldSource.ColorScheme
        sldInserted.DisplayMasterShapes = sldSource.DisplayMasterShapes
        'Copy the background
        CopyBackground(sldSource, sldInserted)
        'Hyperlinks
        If _hyperlinkSupport And mySlide.HyperLinks.Count > 0 Then
            AssignHyperLinks(mySlide, sldInserted)
        End If
        'add UID
        sldInserted.Tags.Add("UID", mySlide.UID)
        'Headers and Footers
        CopySlideHeadersAndFooters(sldInserted, sldSource)
        CopySlideFormatting(sldSource, sldInserted)

        'Has Table?
        If _usesTemplate Then
            Select Case sldInserted.Shapes.Range.HasTable()
                Case msoTrue, msoCTrue, msoTriStateMixed
                    mySlide.HasTable = True
                Case Else
                    mySlide.HasTable = False
            End Select
        End If

        log.Debug("Exiting InsertPptSlide()")

        Return sldInserted
    End Function
Posted
Comments
Simon_Whale 11-Apr-11 3:51am    
Is the powerpoint presentation large?
mangesh from nagpur 11-Apr-11 3:58am    
Yes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900