如何在C#中打开和关闭powerpoint实例 [英] How to open and close an instance of powerpoint in C#
本文介绍了如何在C#中打开和关闭powerpoint实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,我正在做一个应用程序,我在其中启动Office应用程序,如Word,PowerPoint等
所以,我做了Word应用程序,但现在我正在为Powerpoint App做,但我不做知道如何在Powerpoint实例的退出上放置一个事件,并创建一个Powerpoint实例。
这是我为Word应用程序做的:
Hello, I am doing an application in which I launch Office App like Word, PowerPoint etc
So, I did for the Word App but now I am doing for the Powerpoint App but I don't know how to put an event on the exit of an instance of Powerpoint and also create an instance of Powerpoint.
Here is what I did for the Word App:
using wd = Microsoft.Office.Interop.Word;
wd.Application wdApp = new wd.Application();
wdApp.Visible = true;
((wd.ApplicationEvents4_Event)wdApp).Quit += () => { MessageBox.Show("Exited!"); };
我的尝试:
我为Word App做了但不用于Powerpoint App我怎么能这样做?
What I have tried:
I did for the Word App but not for the Powerpoint App how could I do it ?
推荐答案
MS PowerPoint应用程序的可用事件列表在这里: 应用程序事件(Microsoft.Office.Interop。 PowerPoint) [ ^ ]
根据事件描述,您可以使用:EApplication_Event.PresentationClose事件(Microsoft.Office.Interop.PowerPoint) [ ^ ]
A list of avaliable event for MS PowerPoint application is here: Application Events (Microsoft.Office.Interop.PowerPoint)[^]
As per description of events, you may use: EApplication_Event.PresentationClose Event (Microsoft.Office.Interop.PowerPoint)[^]
这篇关于如何在C#中打开和关闭powerpoint实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文