• asp.net创建PPT


    代码:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    using PPT = Microsoft.Office.Interop.PowerPoint;
    using System.IO;
    using System.Reflection; 
    
    namespace WebPPT
    {
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            public void Method()
            {
                string path;
                PPT.Application pptApp;
                PPT.Presentation pptDoc;
                path = @"d:/test.ppt";                           //path = @"d:/test.pps";
                pptApp = new PPT.Application();
                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();
    
            }
    
            protected void Button1_Click(object sender, EventArgs e)
            {
                Method();
            }
    
        }
    }
  • 相关阅读:
    Coursera Algorithm II PA2 Q2
    Coursera Algorithm Part II PA2
    实现 memcpy 函数
    超人
    Proxy 模式
    【6】锋利的 jQuery 笔记
    【3】Chrome 的一些常用操作
    HTML 待解决与已解决问题
    CSS 待解决问题
    JS 一些常用技巧
  • 原文地址:https://www.cnblogs.com/caok168/p/2581284.html
Copyright © 2020-2023  润新知