Jake
Jake

Reputation: 16887

C# convert .ppt to images

I am trying to convert a .ppt file to a collection of images using C#.

I am using the following code :

using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;

.....

Microsoft.Office.Interop.PowerPoint.Application app = new Microsoft.Office.Interop.PowerPoint.Application();

Presentation pres = app.Presentations.Open(@"C:\Users\XYZ\Desktop\Presentation.ppt", MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);

pres.SaveAs(@"C:\Users\XYZ\Desktop\", PpSaveAsFileType.ppSaveAsJPG, MsoTriState.msoFalse);

pres.Close();

I am getting the following exception :

Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

at the line :

Microsoft.Office.Interop.PowerPoint.Application app = 
                      new Microsoft.Office.Interop.PowerPoint.Application();

Is it necessary to have full version of Office 2010 to be installed for this code to work ( I only have a Powerpoint Viewer installed ) or is there some other solution to this exception?

Upvotes: 2

Views: 3109

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039498

You need the full PowerPoint installed in order to achieve this. The viewer cannot manipulate powerpoint files.

Upvotes: 1

Related Questions