Embed Powerpoint into a VB6 Form

I need to embed a Powerpoint into a VB6 Form.

The presentation is auto-advancing so once it has been started, it will need to proceed automatically, as it would in Powerpoint itself.

I also needs to automatically scale into a control on a form, rather than open in a new window.

Does anyone have a code sample to do this?
LVL 1
rpmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MilanKMCommented:
Try to do it with OLE object. Check following link:

http://eserver.bell.ac.uk/mirrors/vb6/pt10_3.htm

:)
2AngelCommented:
Hi,

Very nice, easy and free control from Microsoft is DsoFramer. Try it...

http://support.microsoft.com/default.aspx?scid=kb;en-us;311765
rpmAuthor Commented:
This method looks promising, but I cannot work out how to start the slideshow
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

2AngelCommented:
Hi,
I am writing to from my mobile (I am on the way), so i don't have my computer to give you an example code, but all VBA code are working here...
if you will not find any, i'll help on Monday...
2AngelCommented:
Hi,

Sub SlideShow_Click()

With oDoc.ActivePresentation.SlideShowSettings
   .ShowType = ppShowTypeSpeaker
   .LoopUntilStopped = msoFalse
   .ShowEithNarration = msoTrue
   .ShowWithAnimation = msoTrue
   .RangeType = ppShowAll
   .AdvanceMode = ppSlideShowUseSlideTimings
   .PointerColor.SchemeColor = ppForeground
   .Run
End With

End Sub

Have fun...!
rpmAuthor Commented:
Ok, I created a blank project, put a FramerControl object on the blank form, called it oDoc

I then created a button with the following event:

Private Sub Command1_Click()

  oDoc.Open App.Path & "\welcome.ppt"
 
  With oDoc.ActivePresentation.SlideShowSettings
    .ShowType = ppShowTypeSpeaker
    .LoopUntilStopped = msoFalse
    .ShowEithNarration = msoTrue
    .ShowWithAnimation = msoTrue
    .RangeType = ppShowAll
    .AdvanceMode = ppSlideShowUseSlideTimings
    .PointerColor.SchemeColor = ppForeground
    .Run
  End With

End Sub

When I click the button the PPT loads, and then I get the following error:

"Objject doesn't support this property or method"

This error occurs on the WITH line!
2AngelCommented:
>This error occurs on the WITH line!

Which with line? On the code? Strage...
rpmAuthor Commented:
With oDoc.ActivePresentation.SlideShowSettings
2AngelCommented:
O.K.

First, you have to set reference to: Microsfot PowerPoint 10.0 Object Libery.

Second, here is the full code that works for me:

Private Sub Command1_Click()
Dim oDoc As PowerPoint.Presentation
FramerControll.Open (App.Path & "\welcome.ppt")
Set oDoc = FramerControll.ActiveDocument
With oDoc.SlideShowSettings
    .ShowType = ppShowTypeSpeaker
    .LoopUntilStopped = msoFalse
    .ShowEithNarration = msoTrue
    .ShowWithAnimation = msoTrue
    .RangeType = ppShowAll
    .AdvanceMode = ppSlideShowUseSlideTimings
    .PointerColor.SchemeColor = ppForeground
    .Run
End With
End Sub

* Please note that oDoc is you ActiveDocument and the DsoFramer called FramerControll.

Good luck...
rpmAuthor Commented:
Thank you for your continued support with this issue, unfortunatly we are still not quite there!

The above solution does indeed open the PPT and display it, but unfortunatly it appears in fulscreen mode, not in the object on the form.

I tried .ShowType = ppShowTypeWindow, but that displayed the PPT in a new Window.

Is there a way to make the PPT display within the FramerControl?
2AngelCommented:
Hi,

Change the line > .ShowType = ppShowTypeSpeaker
to: .ShowType = ppShowTypeWindow
2AngelCommented:
Oooppsss, Just now I see that already tryed that....
I'll think of something else...
2AngelCommented:
What is exactly you what to achieve?
What is the purpose of your project?
Maybe will try some thind else, maybe "Automation" of PowerPoint?
rpmAuthor Commented:
It is a message board package for public locations, which displays various messages and various times.

There is a main message panel on screen, along with vrious other panels.

The main panel mainly contains HTML pages, but I have been asked to allow PPTs to be shown in that panel too!

Richard
2AngelCommented:
The PPT must show the SlideShow or it can show on slide at a time?
rpmAuthor Commented:
The system must run completely unattended, so it needs to automatically progress through the slideshow
2AngelCommented:
I've try so many thing, sometimes it's worked & sometimes not... this component has some bugs.
If you know C you can fix it or ajust it as you like (the source code came whith the download zip)
Other idea is to use the ppt component.....
http://www.codeproject.com/useritems/mclhotkey.asp
http://support.microsoft.com/kb/222929/en-us
http://www.google.com/search?hl=iw&as_qdr=all&q=vb+powerpoint+automation+site%3Amicrosoft.com&btnG=%D7%97%D7%99%D7%A4%D7%95%D7%A9&lr=

Good luck!
2AngelCommented:
I am sorry - I have don my best....

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rpmAuthor Commented:
Although the problem has not be solved with 100% satisfaction, I do recognise the immense effort that 2Angel has made to solve this problem and the genuine usefulness of his comments, and hence award the points ...
2AngelCommented:
Thanks!
Good luck to you....
themathprofCommented:
Hi 2angel,

I implemented your code using the FramerControl1 from MS. Here's what happens when I link to a ppsx . The ppsx show opens in a new window (form) and the corresponding pptx opens in the framer control. How can I get just the ppsx to open and have it open in the framercontrol?
Thanks.
I'm using VB6.


Private Sub Command1_Click()
Dim oDoc As PowerPoint.Presentation
FramerControll.Open (App.Path & "\welcome.ppt")
Set oDoc = FramerControll.ActiveDocument
With oDoc.SlideShowSettings
    .ShowType = ppShowTypeSpeaker
    .LoopUntilStopped = msoFalse
    .ShowEithNarration = msoTrue
    .ShowWithAnimation = msoTrue
    .RangeType = ppShowAll
    .AdvanceMode = ppSlideShowUseSlideTimings
    .PointerColor.SchemeColor = ppForeground
    .Run
End With
End Sub
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.