本文介绍了将PPT转换为PPTX并在c#中保存在内存流中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



任何人帮我将PPT转换为PPTX并使用c#保存在内存流中。



提前致谢。





问候

pragu

Hi Guys,

Anyone help me on converting PPT to PPTX and save in memory stream using c#.

Thanks in advance.


Regards
pragu

推荐答案

using System;
using System.Collections.Generic;
using System.Text;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Microsoft.Office.Core;
namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            PowerPoint.Application app = new PowerPoint.Application();
            string sourcePptx = @"d:\test.ppt";
            string targetPpt = @"d:\test.pptx";
            object missing = Type.Missing;
            PowerPoint.Presentation pptx = app.Presentations.Open(sourcePptx, MsoTriState.msoTrue
                , MsoTriState.msoTrue, MsoTriState.msoTrue);
            pptx.SaveAs(targetPpt
                , PowerPoint.PpSaveAsFileType.ppSaveAsDefault);
            app.Quit();
        }
    }
}



这篇关于将PPT转换为PPTX并在c#中保存在内存流中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 07:57