设为首页 加入收藏

TOP

c# 将PPT转换成HTML(一)
2019-09-02 23:42:48 】 浏览:100
Tags:PPT 换成 HTML

这只是一个小程序,就是将ppt转换成html,方法很多,为了以后备用,在此记录一下,也和大家分享 源码如下: using System; using System.Collections.Generic; using System.Text; using System.IO; using PPT = Microsoft.Office.Interop.PowerPoint; using

 

这只是一个小程序,就是将ppt转换成html,方法很多,为了以后备用,在此记录一下,也和大家分享
  源码如下:
   

using System;
  using System.Collections.Generic;
  using System.Text;
  using System.IO;
  using PPT = Microsoft.Office.Interop.PowerPoint;
  using System.Reflection;

namespace WritePptDemo
  {
      class Program
      {
          static void Main(string[] args)
          {
              string   path;         //文件路径变量

              PPT.Application pptApp;     //Excel应用程序变量
                PPT.Presentation pptDoc;     //Excel文档变量

              PPT.Presentation pptDoctmp;

           

            path   = @"C:\MyPPT.ppt";      //路径
              pptApp =   new PPT.ApplicationClass();   //初始化

            //如果已存在,则删除
              if   (File.Exists((string)path))
              {
                    File.Delete((string)path);
              }

            //由于使用的是COM库,因此有许多变量需要用Nothing代替
              Object   Nothing = Missing.Value;
              pptDoc =   pptApp.Presentations.Add(Microsoft.Office.Core.MsoTriState.msoFalse);
                pptDoc.Slides.Add(1,   Microsoft.Office.Interop.PowerPoint.PpSlideLayout.ppLayoutText);

              string text = "示例文本";

            foreach   (PPT.Slide slide in pptDoc.Slides)
              {
                    foreach (PPT.Shape shape in slide.Shapes)
                    {

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/12/12
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇私有构造函数的特点和用途 下一篇窗体与子线程的交互

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目