首页 > 其他 > 详细

如何读取ppt内容

时间:2014-11-12 19:46:45      阅读:284      评论:0      收藏:0      [点我收藏+]

1、java版本
public string PptReader(string filename)
{
string fullname = DocPath+filename; //绝对路径
PowerPoint.Application papp = new PowerPoint.Application();
PowerPoint.Presentation ppr = papp.Presentations.Open(fullname, Microsoft.Office.Core.MsoTriState.msoCTrue,
MsoTriState.msoFalse, MsoTriState.msoFalse);
string doc = "";
foreach (PowerPoint.Slide slide in ppr.Slides)
{
foreach (PowerPoint.Shape shape in slide.Shapes)
{
if (shape.HasTextFrame. == MsoTriState.msoTrue)
{
if (shape.TextFrame.HasText == MsoTriState.msoTrue)
{
doc += shape.TextFrame.TextRange.Text.ToString();
doc += "/n";
}
}

}
}

ppr.Close();
System.Runtime.InteropServices.Marshal.ReleaseComObject(ppr);
ppr = null;
papp.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(papp);
papp = null;
return doc;
}

后续提供javascript如何读取ppt,欢迎交流!

如何读取ppt内容

原文:http://blog.csdn.net/zcc_0015/article/details/41048175

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!