Click here to Skip to main content
15,884,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to Convert PPT to HTML using Microsoft.Office.Interop.PowerPoint DLL
for this i want read the PPT file like HTML format.

i don't want to use following code..

C#
Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();

Presentation prsPres = ppApp.Presentations.Open(strSourceFile, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);

prsPres.SaveAs(strDestinationFile, PpSaveAsFileType.ppSaveAsHTML, MsoTriState.msoTrue);


I want to create HTML page with Different format...
Can any one Help me.......
Posted
Updated 2-Aug-11 0:50am
v4

1 solution

There are really two options here. First, you can use the PowerPoint API to iterate over all the slides, objects etc within the presentation, and create HTML elements representing each one that display how you want. And second, you can let PowerPoint generate the HTML and then post-process it (with string manipulation, XSLT or with the XML handling classes, depending on what you want to do).

Well, there is a third way if the changes you want are very minor, possibly (I don't know what the HTML produced by PowerPoint is like): skin it with a CSS, which you can patch in as a <link> tag. (You might need to remove some or all of the styling run inline by Microsoft, too.) This approach cannot change the content of the document, only style information, so the changes you can make this way are limited.

Both of them are fairly bad solutions and difficult to maintain when Microsoft change how PowerPoint works, even quite subtlely. If you can do it with a CSS then that is relatively clean, although still susceptible to Microsoft changing class or element names.

Depending on where the requirement to do it differently came from, your best solution might be to put the case to management that it is more effort than it is worth. If you want HTML presentations then starting from PowerPoint is almost certainly the wrong idea to start with.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900