Results 1 to 7 of 7

Thread: Running Power Point Show from VB

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    New Delhi, India
    Posts
    47

    Running Power Point Show from VB

    Running Power Point Show from VB

    Hi,

    I am creating an application in VB, wherein the left portion of a form is being used to get input from the user while the right portion of the form is going to be used for displaying Power Point Slide show.

    I have created some PPS (Power Point Show) files and am calling it from the VB form, by using PowerPoint Object.

    The problem is that PPS runs in its own process and I am not able to run it within a specified space or container in my form. i.e when I call the PPS file from VB, it starts with a full screen view. I have written some code to manage the PPS window, but that gets executed only after the PPS has started running.
    Secondly, the PPS which is now running is running in its own process. Consequently, the user can close the PPS or the VB application individually, which I don’t want, because both are integrated.

    Please help me on this front.

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    why not make the PP object invisible and disallow closing of the form?

    then when you have to show them a presentation, you can make the PP object visible again ?

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    This should get you started:
    VB Code:
    1. *'Note:
    2. *'Add Microsoft Powerpoint 8.0Oject Library Office '97 in References
    3. *'This code snipplet come from Microsoft Office Development site
    4.  
    5. Add commandbuuton in the from and name it cmdOpenPPT
    6. In cmdOpenPPT_Click add the code below:
    7.   OpenPresentation(strFilename)
    8.  
    9. '*  strFilename = Powerpoint Presentation File
    10.  
    11. Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
    12.  
    13. Private Sub OpenPresentation(strFilename As String)
    14.     Dim oPPT As PowerPoint.Application
    15.     Set oPPT = New PowerPoint.Application
    16.    
    17.        
    18.     'open a powerpoint file
    19.     With oPPT
    20.         .Visible = True
    21.         .Presentations.Open (strFilename)
    22.         .Presentations(strFilename).Close
    23.     End With
    24.            
    25.     'View the slide show
    26.    
    27.     Sleep 500
    28.     With oPPT.ActivePresentation.SlideShowSettings
    29.         .AdvanceMode = ppSlideShowUseSlideTimings
    30.         .Run
    31.     End With
    32.    
    33.    
    34.     'Wait until there are no more slide show windows and then quit
    35.     'Powerpoint
    36.     Do
    37.        Sleep 1000
    38.     Loop While oPPT.SlideShowWindows.Count > 0
    39.     oPPT.Quit
    40.     Set oPPT = Nothing
    41. End Sub
    42.  
    43. Private Sub cmdOpenPPT_Click()
    44.   OpenPresentation "c:\files\takefive.pps"
    45. End Sub
    Bare in mind it does come from Microsoft so you will probably have to do some tweaking.

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    New Delhi, India
    Posts
    47

    Thanks But already tried

    Thanks hack...This code I have already tried but the same problem...The PPS is running seperately from VB application....It should run within VB application in some container or otherwise...

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Hmmm...I know you can embed and Word document and an Excel spreadhsheet as an OLE object in VB, but I'm not sure about PowerPoint. Let me do a little reasearch and I'll get back to you.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Check out this MSDN link and see if it has anything useful for you.

    http://msdn.microsoft.com/library/de...ml/ppkbppt.asp

  7. #7
    Lively Member
    Join Date
    Sep 2006
    Posts
    66

    Re: Running Power Point Show from VB

    This link is no longer valid..is there another example somewhere on how to embedd a Powerpoint presentation into VB?

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