如何保存的* .ppt,* .PPTX文件,* .WMV使用互操作使用C#? [英] How to save *.ppt, *.pptx files as *.wmv using Interop with C#?
本文介绍了如何保存的* .ppt,* .PPTX文件,* .WMV使用互操作使用C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想下一个code做到这一点:
I tried to do this with the next code:
using Microsoft.Office.Core;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.IO;
using Microsoft.Office.Interop.PowerPoint;
namespace SavePPT
{
class Program
{
static void Main(string[] args)
{
Application app = new PowerPoint.Application();
var pres = app.Presentations;
var file = pres.Open(@"C:\Presentation1.pptx", MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse);
file.SaveCopyAs(@"C:\presentation1.wmv", PowerPoint.PpSaveAsFileType.ppSaveAsWMV, MsoTriState.msoCTrue);
app.Quit();
}
}
}
不过,当然这种解决方案创建的0 KB大小的文件,我不能玩。
But this solution created file with 0 KB size and of course I can't play it.
推荐答案
PowerPoint的SaveCopyAs方法似乎并不支持ppSaveAsWMV。它明确指出,它支持在<一个href="http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint._$p$psentation.savecopyas.aspx"相对=nofollow> MSDN页 SaveCopyAs,其中不包括ppSaveAsWMV不变。
PowerPoint's SaveCopyAs method doesn't appear to support ppSaveAsWMV. It explicitly states which it supports on the MSDN page for SaveCopyAs, which doesn't include the ppSaveAsWMV constant.
这篇关于如何保存的* .ppt,* .PPTX文件,* .WMV使用互操作使用C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文