从C#窗口窗口打开Powerpoint演示文稿。 [英] Open Powerpoint Presentation from C# Window Form.

查看:199
本文介绍了从C#窗口窗口打开Powerpoint演示文稿。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在使用c#在Office PowerPoint 2007上工作。我想打开power point文档,所以我已经完成了相同的代码。但我面临一个问题。我附加了代码spinet如下。我还添加了`Microsoft.Office.Interop.PowerPoint.dll




Hello,
i am working on Office PowerPoint 2007 using c#. i want to open the power point document, so i have done some code for the same. but am facing one problem. i have attached code spinet as follow.And i also add the reference of `Microsoft.Office.Interop.PowerPoint.dll


Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
            ppApp.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
            Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;
            Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"D:\Office\temp.pptx", Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse,
            Microsoft.Office.Core.MsoTriState.msoTrue);





但我收到这样的错误信息





类型Microsoft.Office.Core.MsoTriState在未引用的程序集中定义。您必须添加对程序集'office,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c'的引用。





i尝试在谷歌搜索此错误,但我无法正确解决此错误。



如何解决?



But i got error message like this


The type 'Microsoft.Office.Core.MsoTriState' is defined in an assembly that is not referenced. You must add a reference to assembly 'office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.


i try to search this error on google but i can't get proper way to solve this error.

How can i solve it ?

推荐答案

在找到的文件夹中 Microsoft .Office.Interop.PowerPoint.dll ,还有一个 office.dll 。添加对它的引用。
In the folder where you found Microsoft.Office.Interop.PowerPoint.dll, there is also a office.dll. Add a reference to it.


这篇关于从C#窗口窗口打开Powerpoint演示文稿。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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