如何将powerpoint转换为html
来源:互联网 发布:鱼具淘宝网 编辑:程序博客网 时间:2024/05/20 14:16
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
我们当然要使用Com组件了,所以要先安装powerpoint2000,在VS.NET里面添加一个refrence,找到microsoft PowerPoint object library 9.0,添加进来。
然后写如下代码,很简单,我就不必解释了:)
using System;
using Office;
using PowerPoint;
namespace CourseServer.Course
{
/// <summary>
/// Author:王洪超
/// Version:1.0
/// Date:2001/6/9
/// Description:转换PowerPoint的PPT文件为html文件
/// </summary>
public class ConvertPowerPoint
{
/// <summary>
/// 建立对PowerPoint.Application的Com组件的引用
/// </summary>
private PowerPoint.Application ppt;
/// <summary>
/// 指向具体的文件;
/// </summary>
private PowerPoint.Presentation pptFile;
private string _htmlFileName;
/// <summary>
/// 只写属性,设置另存的html文件的文件路径
/// </summary>
public string htmlFileName
{
set
{
_htmlFileName=value;
}
}
/// <summary>
/// 构造器
/// </summary>
public ConvertPowerPoint()
{
//
// TODO: Add constructor logic here
//
ppt=new PowerPoint.Application();
}
/// <summary>
/// 转换过程
/// </summary>
/// <param name="pptFileName">欲转换的PowerPoint文件名称</param>
public void Convert(string pptFileName)
{
pptFile=ppt.Presentations.Open(pptFileName,Office.MsoTriState.msoTrue,Office.MsoTriState.msoCTrue,Office.MsoTriState.msoFalse);
pptFile.SaveAs(_htmlFileName,PowerPoint.PpSaveAsFileType.ppSaveAshtml,Office.MsoTriState.msoCTrue);
pptFile.Close();
}
}
}
&n
转换为html';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
如何使用.NET将PowerPoint转为html文件我们当然要使用Com组件了,所以要先安装powerpoint2000,在VS.NET里面添加一个refrence,找到microsoft PowerPoint object library 9.0,添加进来。
然后写如下代码,很简单,我就不必解释了:)
using System;
using Office;
using PowerPoint;
namespace CourseServer.Course
{
/// <summary>
/// Author:王洪超
/// Version:1.0
/// Date:2001/6/9
/// Description:转换PowerPoint的PPT文件为html文件
/// </summary>
public class ConvertPowerPoint
{
/// <summary>
/// 建立对PowerPoint.Application的Com组件的引用
/// </summary>
private PowerPoint.Application ppt;
/// <summary>
/// 指向具体的文件;
/// </summary>
private PowerPoint.Presentation pptFile;
private string _htmlFileName;
/// <summary>
/// 只写属性,设置另存的html文件的文件路径
/// </summary>
public string htmlFileName
{
set
{
_htmlFileName=value;
}
}
/// <summary>
/// 构造器
/// </summary>
public ConvertPowerPoint()
{
//
// TODO: Add constructor logic here
//
ppt=new PowerPoint.Application();
}
/// <summary>
/// 转换过程
/// </summary>
/// <param name="pptFileName">欲转换的PowerPoint文件名称</param>
public void Convert(string pptFileName)
{
pptFile=ppt.Presentations.Open(pptFileName,Office.MsoTriState.msoTrue,Office.MsoTriState.msoCTrue,Office.MsoTriState.msoFalse);
pptFile.SaveAs(_htmlFileName,PowerPoint.PpSaveAsFileType.ppSaveAshtml,Office.MsoTriState.msoCTrue);
pptFile.Close();
}
}
}
&n
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 如何将powerpoint转换为html
- 如何将Powerpoint文档转换为Word文档
- PowerPoint如何将演示文稿转换为WORD文档
- 将Powerpoint文档转换为Word文档
- 将office文档(word,excel,powerpoint)转换为pdf
- 将office文档(word,excel,powerpoint)转换为pdf
- 如何将HTML转换为纯文本格式Text
- 如何将一段字符串转换为HTML格式
- 如何将ipynb转换为html,md,pdf等格式
- 如何将头部html和尾部html转换为js,并加载到每个页面中
- 将PowerPoint转换为视频的软件——ppt2wmv的使用
- 将PowerPoint转换为视频的软件——ppt2wmv简介
- 将PowerPoint转换为视频的软件——ppt2wmv系统需求
- 将Rtf转换为Html格式
- 将Datatable数据转换为HTML方法
- 将aspx页面转换为html页面
- 使用XPDF将PDF转换为HTML
- 将Datatable数据转换为HTML方法 .
- 建立文件交换功能的脚本(三)
- 关于从toolbox内拖放控件到form时出错的解决办法
- 聊天室php&mysql(一)
- 映射 -- zt 统一教学网
- 建立文件交换功能的脚本(二)
- 如何将powerpoint转换为html
- 福利彩票幸运号码自动生成器
- 用C#与XML创建动态分层菜单
- 利齿C sharp代替C++?
- 建立文件交换功能的脚本(一)
- 使用基本类库 -- zt 统一教学网
- 一个用php3编写的简单计数器
- Numeric Parse Method
- 网站当前的在线人数