开发者

Run PPT in browser as a .ppt [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

I have seen a powerpoint presentation (ppt) somewhere online which was a .ppt file and it ran within the web browser. So no need for exporting to html, swf, etc and it 开发者_JAVA百科was rather good quality when it came to images.

Any ideas how to do this?


Try this code

string ExportLocation = "C:\\Sample";
Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
ppApp.Visible = MsoTriState.msoTrue;
ppApp.WindowState = PpWindowState.ppWindowMinimized;
Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;
Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open("C:\\ScreenShots.ppt",
            MsoTriState.msoFalse, MsoTriState.msoFalse,
            MsoTriState.msoFalse);
ppApp.ShowWindowsInTaskbar = MsoTriState.msoFalse;  //Hiding the application; But it will be displayed always
try
{
    Slides objSlides = oPres.Slides;    //Getting all the slides
    for (int i = 1; i < objSlides.Count - 1; i++)
    {
        string file = Path.Combine(ExportLocation, string.Format("{0}.{1}", objSlides[i].Name, "jpg"));
        oPres.Slides[i].Export(file, "jpg", 800, 600);
    }
}
finally
{
    ppApp.Quit();   //Closing the Powerpoint application. Sometimes it won't work too.
}


For a single presentation you can use Google Docs' presentation "Embed" feature (upload the ppt to Google Docs, then click Share...publish / embed).

For a systematic solution based also on this, I suggest taking a look at Google Docs' API

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜