Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using C# to display powerpoint

Is there any good way to use a windows application written in C# to display/control a powerpoint slideshow? Ultimately I would like to show thumbnails in a form and clicking these thumbnails would advance the slides shown on a second monitor (similar to using Powerpoint itself to show a slideshow on a second monitor).

I would like to be able to use Powerpoint Viewer if Powerpoint is not installed.

There seems to be some ActiveX-controls that allows integration of Powerpoint in a form, but most of these seem to cost money, does anyone have experience using one of these controls?

Edit: I know that there is an object model accessable by adding a reference to Microsoft.Office.InterOp.Powerpoint, but I want to be able to distribute the resulting program without having Microsoft Office as a prerequisite, that was why I mentioned Powerpoint Viewer because it can be distributed freely.

like image 356
Berg Avatar asked Feb 04 '23 13:02

Berg


2 Answers

This kb lays out the basics for working with the powerpoint presentation viewer object model. I'd suggest you include the viewer when you distribute your application.

http://support.microsoft.com/kb/265385

Once you get a reference to the viewer (top level) object it is basically the same as working with the powerpoint.presentation object model, but with less functionality (i.e. editing, etc)

If you are working with Powerpoint 2007, then you can add editing functionality by using the System.XML and related namespaces to work with the presentation file as an open xml file.

Regarding the comments about UNO/openoffice.org, I think these miss the point, as you cannot use UNO for working with powerpoint, it is for openoffice and that was not the origianl requirement of the questioner.

there are 3rd party toolsets like aspose, but then your goal was to work with the powerpoint viewer component (free) so I'm guessing you want to avoid paying for dev tools? Either way viewer components OM is perfectly suitable for displaying and previewing and existing slide show. (you will need one copy of Powerpoint so that you can author the presentation from scratch, plus Visual Studio to create the VSTO project).

like image 114
Anonymous Type Avatar answered Feb 06 '23 03:02

Anonymous Type


One of our softwares here at work does that. Initially we used MS Office but recently we switched to use OpenOffice.org Uno since it offers better control than MS Office and is easier to work with. It has .NET CLI-bindings.

To answer your question, yes it can be done but our engineers would recommend you use OpenOffice.org instead.

like image 36
David Holm Avatar answered Feb 06 '23 01:02

David Holm