合并2个PPT【Access,word同理】(来自www.yesur.com)

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

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

}

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航