使用C#创建PowerPoint文档
2008-04-18 23:45
489 查看
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using PPT = Microsoft.Office.Interop.PowerPoint; //11.0-2003,12.0-2007
namespace CreatePPTDemo
{
calss Program
{
static void Main(string[] args)
{
string path;
PPT.Application pptApp;
PPT.Presentation pptDoc;
path = @"d:/test.ppt"; //path = @"d:/test.pps";
pptApp = new PPT.ApplicationClass();
if(File.Exists(path))
{
File.Delete(path);
}
Object nothing = Missing.Value;
pptDoc = pptApp.Presentations.Add(Microsoft.Office.Core.MsoTriState.msoFalse);
PPT.PpSaveAsFileType format = PPT.PpSaveAsFileType.ppSaveAsDefault;
//PPT.PpSaveAsFileType.ppSaveAsShow;
pptDoc.SaveAs(path,format,Microsoft.Office.Core.MsoTriState.msoFalse);
pptDoc.Close();
pptApp.Quit();
}
}
}
using System.Collections.Generic;
using System.IO;
using System.Text;
using PPT = Microsoft.Office.Interop.PowerPoint; //11.0-2003,12.0-2007
namespace CreatePPTDemo
{
calss Program
{
static void Main(string[] args)
{
string path;
PPT.Application pptApp;
PPT.Presentation pptDoc;
path = @"d:/test.ppt"; //path = @"d:/test.pps";
pptApp = new PPT.ApplicationClass();
if(File.Exists(path))
{
File.Delete(path);
}
Object nothing = Missing.Value;
pptDoc = pptApp.Presentations.Add(Microsoft.Office.Core.MsoTriState.msoFalse);
PPT.PpSaveAsFileType format = PPT.PpSaveAsFileType.ppSaveAsDefault;
//PPT.PpSaveAsFileType.ppSaveAsShow;
pptDoc.SaveAs(path,format,Microsoft.Office.Core.MsoTriState.msoFalse);
pptDoc.Close();
pptApp.Quit();
}
}
}
相关文章推荐
- 使用c#在word文档中创建表格的方法详解
- 使用C#为PowerPoint文档插入部分文本或图片
- 使用C#创建Excel文档
- 使用C#在Excel文档中创建图表
- 使用C#创建Word文档
- 剖析C# 2.0泛型类的创建和使用(二)
- C#调用NPOI创建Excel文档合并后的单元格写入数据问题一则
- 如何使用C#创建WebService
- 用C#编程实现在PowerPoint文档中搜索文本
- 如何使用 Visual C# .NET 创建 ASP.NET HTTP 模块
- c#中使用ServiceStack创建服务简单示例
- ElasticSearch入门 第四篇:使用C#添加和更新文档
- 使用SandCastle创建.Net帮助文档
- C#使用SqlBulkCopy将DataTable写入数据库的表中(表不存在则创建新表,数据存在则更新,不存在则插入)
- C#使用Windows Service的简单教程(创建、安装、卸载、调试)
- 使用C#创建SQLite控制台应用程序
- 常量,字段,构造方法 调试 ms 源代码 一个C#二维码图片识别的Demo 近期ASP.NET问题汇总及对应的解决办法 c# chart控件柱状图,改变柱子宽度 使用C#创建Windows服务 C#服务端判断客户端socket是否已断开的方法 线程 线程池 Task .NET 单元测试的利剑——模拟框架Moq
- C#中使用XSLT文件将XML文档转换为HTML
- C#程序通过模板自动创建Word文档
- C# 中使用Word文档对图像进行操作