Display Powerpoint presentation within my own form?

G

Guest

Hello, I have the following problem and I do not know how to accomplish this.

I have an (existing) powerpoint presentation that should be displayed not
within its own window, but within a control of my own form.

So I added a reference to the Microsoft PowerPoint Object Library and tried
to run a slideshow of the presentation. For this I am using those classes
like PowerPoint.Application, PowerPoint.Presentation, PowerPoint.Slides, ...
This works fine, as long as the slideshow runs in its own window.

But I have no idea how to make the slideshow run within my form (or panel or
pictureBox or whatever) - or if this is possibly at all. After several days
of internet search I have got the impression that nobody else ever had the
same intention...

Does anyone have an idea?
Thank you for any help.
 
N

Nicholas Paldino [.NET/C# MVP]

Sensei76,

There is no way outright to do this. What you need is an OLE container.
Unfortunately, MS didn't provide one with .NET 2.0. There was one in the
betas, but they removed it.

The best I can recommend is to use the one distributed with VB6, and use
that through interop.

Hope this helps.
 
G

Guest

Sensei76,
Just drop a WebBrowser Control on the form and do this:

this.axWebBrowser1.Navigate("about.blank");
string path= System.Environment.CurrentDirectory +@"\"+"presentation1.ppt";
this.axWebBrowser1.Navigate(path);

Cheers,
Peter
 
T

Tim Anderson

Sensei76 said:
Hello, I have the following problem and I do not know how to accomplish
this.

I have an (existing) powerpoint presentation that should be displayed not
within its own window, but within a control of my own form.

I made a start on this (hosting OLE documents) with the htmleditor

http://www.itwriting.com/htmleditor/index.php

If you have a bit of time on your hands, I suspect you could hack this, or
do your own implementation, to display a PowerPoint document.

I also suspect that the official support was dropped because Microsoft found
it difficult to get a satisfactory generic solution - so a dedicated
PowerPoint control might work OK.

This is pure speculation I admit. But I'd be interested in the results :)

Tim
Visual Studio 2005 DLL Hell:
http://www.itwriting.com/blog/?postid=261
 
G

Guest

Thank you all for your answers.
It seems like I reached a dead end for this task...

@Luis Arvayo:
Although this looks like the easiest workaround among the given suggestions,
this is not an option. In the finished poduct it will be possible for the end
user to import his own PP presentations, too. But we have to expect the the
target group to have the least possible computer knowledge. So an extra step
before the import, like a conversion, might become a problem. :-(

@Peter Bromberg:
We are still using Framework 1.1, so unfortunatelly the webbrowser control
is available here.

About Nicholas Paldino's and Tim Anderson's suggestions, I am going to
investigate on that and see how far I can get.

Thanks again,
Jens Hellmann
 
T

Tim Anderson

Sensei76 said:
Thank you all for your answers.
@Peter Bromberg:
We are still using Framework 1.1, so unfortunatelly the webbrowser control
is available here.

You can use a webbrowser control in 1.1. You have to add it to the toolbox
from the COM components part of dialog. It is called Microsoft Web Browser.

This is actually the supported way to host ActiveX documents in .NET, but it
is inflexible and also suffers from the overhead of hosting IE along with
your document.

Tim
Mono "stable for all users":
http://www.itwriting.com/blog/?postid=271
 
G

Guest

As things look like at the moment, this is our way to go.
So I am going to use the WebBrowser Control.
[...] and also suffers from the overhead of hosting IE
along with your document.
Well, I am curious to see what kind of complications I now add to the
application... :)

Thanks again!
 
G

Guest

Well, I am curious to see what kind of complications I
now add to the application.
It looks like I found a new complication. :-(

This aforementioned solution seemed to work on our testing machines, the ppt
files were opened only within the control.
On some systems, however, it happens that the presentations gets opened
in a NEW window.

I was not able to find the reason for this. I suppose that it has to do
with the internet security settings of the affected systems, but I could not
verify this.

Does anyone have an explanation for this behaviour?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top