471,325 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Display Powerpoint presentation within my own form?

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.
Jan 11 '06 #1
9 7906
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sensei76" <Se******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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.

Jan 11 '06 #2
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
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Sensei76" wrote:
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.

Jan 11 '06 #3

"Sensei76" <Se******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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

Jan 11 '06 #4
Other sollution is to convert the powerpoint to flash then use the flash
activex inside your form.

There are a lot of third party that converts automatically from ppt to
flash, just google search with "powerpoint to flash". example:

http://www.masternewmedia.org/2004/0...sion_tools.htm
"Tim Anderson" <ti*****@nospam.hotmail.com> escribió en el mensaje
news:uA**************@TK2MSFTNGP09.phx.gbl...

"Sensei76" <Se******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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

Jan 11 '06 #5
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
Jan 12 '06 #6

"Sensei76" <Se******@discussions.microsoft.com> wrote in message
news:7C**********************************@microsof t.com...
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
Jan 12 '06 #7

"Tim Anderson" <ti*****@nospam.hotmail.com> wrote in message
news:OY**************@TK2MSFTNGP11.phx.gbl...

"Sensei76" <Se******@discussions.microsoft.com> wrote in message
news:7C**********************************@microsof t.com... 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.


Further to this, I discovered that you can get a ref to the hosted Office
doc. in the WebBrowser control:

http://www.itwriting.com/blog/?postid=273

Tim
Read my tech blog:
http://www.itwriting.com/blog

Jan 13 '06 #8
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!
Jan 13 '06 #9
> 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?
Jun 2 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by C Williams | last post: by
1 post views Thread by Tor Inge Rislaa | last post: by
reply views Thread by Alexander Czernay | last post: by
4 posts views Thread by HibernatingBear | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.