将PPT转换为PPTX并在c#中保存在内存流中 [英] Convert PPT to PPTX and save in memory stream in c#

查看:374
本文介绍了将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

推荐答案

你可以使用这样的东西...



使用Office Interop,你可以探索它以获得更多...



you can use something like this...

Use Office Interop and you can explore it to get more...

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();
        }
    }
}


Hay谢谢你的回复。



i已经尝试了这个,它工作正常。



i想知道如何将ppt转换为pptx并将其保存在内存流中。



我也想知道是否有可能转换出这个声明(即没有SaveAs())





ppt.SaveAs(targetPptx,PowerPoint.PpSaveAsFileType.ppSaveAsPowerPoint4);
Hay thanks for your reply.

i have already tried this, its working fine.

i want to know how to convert ppt to pptx and save it in memory stream.

also i want to know whether it is possible to convert with out this statement (i.e, without SaveAs())


ppt.SaveAs(targetPptx, PowerPoint.PpSaveAsFileType.ppSaveAsPowerPoint4);


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆