在浏览器中以.ppt身份运行PPT

时间:2011-03-16 10:10:48

标签: powerpoint

我在网上看到了一个powerpoint演示文稿(ppt),它是一个.ppt文件,它在网络浏览器中运行。因此,不需要导出到html,swf等,而且在图像方面它的质量非常好。

任何想法如何做到这一点?

2 个答案:

答案 0 :(得分:1)

试试此代码

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.
}

答案 1 :(得分:0)

对于单个演示文稿,您可以使用Google文档的演示文稿“嵌入”功能(将ppt上传到Google文档,然后点击共享...发布/嵌入)。

对于基于此的系统解决方案,我建议您查看Google Docs' API