Results 1 to 3 of 3

Thread: Open powerpoint in vb??????

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    derby,UK
    Posts
    38

    Post

    CAN ANYONE HELP ME OPEN A SLIDE SHOW (POWERPOINT) IN VB5 OR JUST POWERPOINT.

    THANK YOU ALL :MAD:

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Post This will open powerpoint

    You can open powerpoint like this, using shell (make sure you put in your particular path to the application):
    Code:
    Option Explicit
    
    Private Sub Command1_Click()
        
        Dim lRetVal As Long
        lRetVal = Shell("c:\program files\microsoft office\" & _
            "office\powerpnt.exe", vbNormalFocus)
        
    End Sub
    To open a particular presentation, just follow the above path with a space, and then the path of the presentation, as in:
    Code:
    Option Explicit
    
    Private Sub Command1_Click()
        
        Dim lRetVal As Long
        lRetVal = Shell("c:\program files\microsoft office\" & _
            "office\powerpnt.exe c:\MyPresentations\Presentation1.ppt", vbNormalFocus)
        
    End Sub
    ~seaweed

    Edited by seaweed on 02-24-2000 at 06:24 PM

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Or you can instatiate a PowerPoint object.
    Add a reference to Microsoft PowerPoint 8.0 Object Library (or the highest version you have installed), then use this code:

    Code:
    Private Sub Command1_Click()
        Dim objPowerPoint As New PowerPoint.Application
        Dim objPresentation As New PowerPoint.Presentation
        
        objPowerPoint.Visible = msoCTrue
        Set objPresentation = objPowerPoint.Presentations.Open("D:\test.ppt")
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width