Connecting Tech Pros Worldwide Forums | Help | Site Map

Display Powerpoint presentation within my own form?

Sensei76
Guest
 
Posts: n/a
#1: Jan 11 '06
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.

Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#2: Jan 11 '06

re: Display Powerpoint presentation within my own form?


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]
- mvp@spam.guard.caspershouse.com

"Sensei76" <Sensei76@discussions.microsoft.com> wrote in message
news:8EE3C791-4E12-418E-98E9-2CC41B68684A@microsoft.com...[color=blue]
> 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.[/color]


Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
#3: Jan 11 '06

re: Display Powerpoint presentation within my own form?


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:
[color=blue]
> 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.[/color]
Tim Anderson
Guest
 
Posts: n/a
#4: Jan 11 '06

re: Display Powerpoint presentation within my own form?



"Sensei76" <Sensei76@discussions.microsoft.com> wrote in message
news:8EE3C791-4E12-418E-98E9-2CC41B68684A@microsoft.com...[color=blue]
> 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.[/color]

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



Luis Arvayo
Guest
 
Posts: n/a
#5: Jan 11 '06

re: Display Powerpoint presentation within my own form?


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" <timjand@nospam.hotmail.com> escribió en el mensaje
news:uAFT9mtFGHA.1288@TK2MSFTNGP09.phx.gbl...[color=blue]
>
> "Sensei76" <Sensei76@discussions.microsoft.com> wrote in message
> news:8EE3C791-4E12-418E-98E9-2CC41B68684A@microsoft.com...[color=green]
>> 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.[/color]
>
> 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
>
>
>[/color]


Sensei76
Guest
 
Posts: n/a
#6: Jan 12 '06

re: Display Powerpoint presentation within my own form?


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
Tim Anderson
Guest
 
Posts: n/a
#7: Jan 12 '06

re: Display Powerpoint presentation within my own form?



"Sensei76" <Sensei76@discussions.microsoft.com> wrote in message
news:7CE306D2-4DF6-4746-8F43-49196F5A7F34@microsoft.com...[color=blue]
> Thank you all for your answers.[/color]
[color=blue]
> @Peter Bromberg:
> We are still using Framework 1.1, so unfortunatelly the webbrowser control
> is available here.[/color]

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


Tim Anderson
Guest
 
Posts: n/a
#8: Jan 13 '06

re: Display Powerpoint presentation within my own form?



"Tim Anderson" <timjand@nospam.hotmail.com> wrote in message
news:OYElCr2FGHA.1192@TK2MSFTNGP11.phx.gbl...[color=blue]
>
> "Sensei76" <Sensei76@discussions.microsoft.com> wrote in message
> news:7CE306D2-4DF6-4746-8F43-49196F5A7F34@microsoft.com...[/color]
[color=blue]
> 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.[/color]

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



Sensei76
Guest
 
Posts: n/a
#9: Jan 13 '06

re: Display Powerpoint presentation within my own form?


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

Thanks again!
Sensei76
Guest
 
Posts: n/a
#10: Jun 2 '06

re: Display Powerpoint presentation within my own form?


> Well, I am curious to see what kind of complications I[color=blue]
> now add to the application.[/color]
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?
Closed Thread