合并2个PPT【Access,word同理】(来自www.yesur.com)
2004-12-24 00:22
344 查看
using System;
using System.Xml;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using PowerPoint;
using Microsoft.Office;
using Microsoft.Office.Core;
namespace cmd
{
/// <summary>
/// opPPT 的摘要说明。
/// </summary>
public class opPPT : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
PowerPoint.ApplicationClass oPP = new PowerPoint.ApplicationClass();
oPP.Visible = MsoTriState.msoTrue;
PowerPoint.Presentations oPresSet = oPP.Presentations;
PowerPoint._Presentation oPres = oPresSet.Open("c://a.ppt",MsoTriState.msoFalse, MsoTriState.msoFalse,MsoTriState.msoTrue);
oPres.Slides.InsertFromFile("c://b.ppt",oPres.Slides.Count,1,-1);
// Run
oPres.SaveAs("c://yesur.ppt",PowerPoint.PpSaveAsFileType.ppSaveAsDefault,MsoTriState.msoCTrue);
// Quit PowerPoint and clean up.
oPres.Close();
System.Runtime.InteropServices.Marshal.ReleaseComObject (oPres);
oPres = null;
System.Runtime.InteropServices.Marshal.ReleaseComObject (oPresSet);
oPresSet = null;
oPP.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject (oPP);
oPP = null;
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
using System.Xml;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using PowerPoint;
using Microsoft.Office;
using Microsoft.Office.Core;
namespace cmd
{
/// <summary>
/// opPPT 的摘要说明。
/// </summary>
public class opPPT : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
PowerPoint.ApplicationClass oPP = new PowerPoint.ApplicationClass();
oPP.Visible = MsoTriState.msoTrue;
PowerPoint.Presentations oPresSet = oPP.Presentations;
PowerPoint._Presentation oPres = oPresSet.Open("c://a.ppt",MsoTriState.msoFalse, MsoTriState.msoFalse,MsoTriState.msoTrue);
oPres.Slides.InsertFromFile("c://b.ppt",oPres.Slides.Count,1,-1);
// Run
oPres.SaveAs("c://yesur.ppt",PowerPoint.PpSaveAsFileType.ppSaveAsDefault,MsoTriState.msoCTrue);
// Quit PowerPoint and clean up.
oPres.Close();
System.Runtime.InteropServices.Marshal.ReleaseComObject (oPres);
oPres = null;
System.Runtime.InteropServices.Marshal.ReleaseComObject (oPresSet);
oPresSet = null;
oPP.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject (oPP);
oPP = null;
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
相关文章推荐
- xmlDoc里面插入xml以及相关举例(来自www.yesur.com)
- Access的密码破解ccrun原创,来自C++ Builder 研究 http://www.ccrun.com
- Linux指令大全(来自www.ChinaJavaWorld.com)
- C++中引用(&)(来自http://www.cnblogs.com/Mr-xu/archive/2012/08/07/2626973.html)
- ORCAD原理图更新到PADS的方法(转帖)(http://www.asmyword.com/forum.php)
- [转-来自啊泰][模板制作技巧4]背景隔行换色 [http://www.cnblogs.com/babyt/archive/2005/03/13/118095.html]
- css渐变 来自张鑫旭-鑫空间-鑫生活[http://www.zhangxinxu.com
- http://www.cisco.com/en/US/docs/wireless/access_point/12.3_8_JA/configuration/guide/s38web.html
- AltiumDesignerPCB库封装命名原则(www.asmyword.com)
- 我的arcgis培训照片4 来自http://www.cioiot.com/successview-549-1.html
- DataGridView显示行号的几种方法来自http://www.soaspx.com/dotnet/csharp/csharp_20100204_2740.html
- stm32 JTAG做普通io口(来自www.ourdev.com)
- 调试javasript 报错 "http://www.baidu.com/s?word=:&tn=s001_dg"
- 从客户端中检测到有潜在危险的Request.Form值的详细解决方案 本文来自:.Net学习网 http://www.lmwlove.com/ac/ID530
- XDocReport 的简单使用 操作word 替换变量,动态图片,指定操作指令(程序)扩展(转自:http://www.cnblogs.com/fish-in-sky/p/4973237.html)
- DataControlRowState 枚举文章来自 中国3A站长学院(www.youaaa.com) - 详文链接:http://www.youaaa.com/html/aspnet/advanced/200812/08-6201_4.h
- 读取文件的最后N行 问题思路来自 http://www.cnblogs.com/cobbliu/archive/2012/03/10/2388802.html
- 打开word出现提示需要安装包gaozhi.msi这个东西 http://www.seekxiu.com/寻修网
- [转-来自啊泰]推模式下dataset1下显示的是"...未找到项目..." 问题的解决[补充] [http://www.cnblogs.com/babyt/archive/2005/04/15/138588.html]
- 【线段树】 来自xuzihanlla “http://www.cnblogs.com/xuzihanllaa/p/8324871.html” 好写不易错