使用c#打开PowerPoint应用程序 [英] Open PowerPoint Application using c#

查看:100
本文介绍了使用c#打开PowerPoint应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用c#在Office PowerPoint 2007上工作。我想打开powerpoint文档,所以我已经为此做了一些代码。但我面临一个问题。我附加了代码spinet如下。




i am working on Office PowerPoint 2007 using c#. i want to open the powerpoint document, so i have done some code for the same. but am facing one problem. i have attached code spinet as follow.

<pre></pre><pre> Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();<br />
            ppApp.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;<br />
            Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;<br />
            Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"D:\Office Guru Support Files\temp.pptx",<br />
            Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse,<br />
            Microsoft.Office.Core.MsoTriState.msoTrue);<br />
 </pre>





i我的例外情况如下......





i am getting exception as follow...

<big></big>The type 'Microsoft.Office.Interop.PowerPoint.Application' exists in both 'f:\Office Guru\PreworkArea\OfficeWork\OfficeWork\obj\Debug\Interop.Microsoft.Office.Interop.PowerPoint.dll' and 'c:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office11\Microsoft.Office.Interop.PowerPoint.dll'	F:\Office Guru\PreworkArea\OfficeWork\OfficeWork\Form1.cs





谁能知道解决这个问题的方法?...它是紧急的。



can anyone know the solution to this problem?...its on urgent basis.

推荐答案

看起来像一个冲突的dll问题 - 你可能已经引用了两个dlls



1)Interop.Microsoft.Office.Interop.PowerPoint.dll'

2)Microsoft.Office.Interop.PowerPoint.dll'



两个都包含对的引用.Microsoft.Office.Interop.PowerPoint.Application()



你可能想删除一个引用并重试。
Looks like an issue of conflicting dlls - you have probably referenced two dlls

1) Interop.Microsoft.Office.Interop.PowerPoint.dll'
2) Microsoft.Office.Interop.PowerPoint.dll'

both of which contain references to Microsoft.Office.Interop.PowerPoint.Application().

You might want to remove one reference and try again.


这篇关于使用c#打开PowerPoint应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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