PowerPoint,演示结束后活动
PowerPoint 2007 仅公开单个演示文稿关闭事件 (PresentationClose
),在演示文稿关闭之前引发。
在我正在处理的几段代码中,我需要跟踪打开的演示文稿,从而对其中一个演示文稿的关闭做出反应。
一般来说PowerPoint提出的事件就足够了。但以下情况除外。
如果演示文稿在关闭时尚未保存,PowerPoint 将显示一个对话框,询问用户是否要保存演示文稿。如果用户单击“是”或“否”,一切都会很好,因为演示文稿最终将关闭。但他也可以选择取消关闭...
在这种情况下,关闭事件被引发,演示文稿仍然存在,但我的应用程序不知道它。
有人可以给我某种解决方法吗?也许是用户单击取消后引发的事件?
PowerPoint 2007 only exposes a single presentation close event (PresentationClose
), which is raised before the closing of the presentation.
In several pieces of code I'm working on, I need to keep track of opened presentations, and therefore to react to one of them being closed.
Generally the event proposed by PowerPoint is enough. Except in the following case.
If the presentation has not been saved when it is closed, PowerPoint displays a dialog asking the user if he wants to save his presentation or not. If the user clicks yes or no, everything is fine since the presentation will eventually be closed. But he can also select to cancel closure...
In this case, the close event is raised, the presentation is still there but my application does not know it.
Can someone give me some kind of workaround? Maybe a event raised after the user clicks on cancel?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要
PresentationBeforeClose< /代码>
或
PresentationCloseFinal
添加于 PowerPoint 2010。如果用户在出现提示时单击“是”进行保存,然后单击“取消”退出“保存演示文稿”窗口,也可能会出现同样的问题。这仍然使演示文稿在应用程序中保持活动状态。
我想出的 PowerPoint 2007 解决方法(灵感来自此处):
You probably want
PresentationBeforeClose
orPresentationCloseFinal
which was added in PowerPoint 2010.You could also have this same problem occur if the user clicks 'Yes' to save at the prompt and then clicks 'Cancel' to exit the Save Presentation window. This still keeps the presentation alive within the application.
PowerPoint 2007 workaround I came up with (inspiration from here):
我想这样的事情就可以做到:
Something like this would do it, I think: