PPT SlidShow by Form

Hi,

I am very new to VB. Can some one provide me sample code. How to open and nevigate PPT using program. I am using following code to goto 3 slide of PPT.

Private Sub CommandButton1_Click()

Dim ppt As Presentation

ppt = Presentations.Open("c:\abc.ppt")

With ppt.SlideShowSettings

.StartingSlide = 3

.Run()

End With

End Sub

I am getting message ""Type 'Presentation' is not define"". Can some one help me how to resolve this peoblem.

How we can use Presentation, Application, SlideShowTransition etc object in our code.

Thank's in advance

Akhlesh



Answer this question

PPT SlidShow by Form

  • Rolando58640

    In fact your question is not VSTO (Visual Studio Tools for the Office System) related.

    It is helpful to remember that this forum is mainly for issues that directly pertain to the Visual Studio Tools for Office tools per se. So you will be best served by posing this question to a forum or newsgroup wholly dedicated to PowerPoint issues such as this one.

    But... I tried to build some code for you that should run without problems:

    Be sure that you add the "Microsoft Powerpoint 11.0 Object Library" to your projects reference list.

    Dim ppt As Presentation
    Dim pwp As PowerPoint.Application

    Set pwp = New PowerPoint.Application
    pwp.Visible = msoTrue

    Set ppt = pwp.Presentations.Open("c:\abc.ppt")

    With ppt.SlideShowSettings
    .StartingSlide = 3
    .AdvanceMode = ppSlideShowManualAdvance
    .Run
    End With

    Hope it helpes,

    -= Maarten =-



  • PPT SlidShow by Form