如何在PowerPoint事件中区分SaveAs呼叫和Save呼叫? [英] How to Differentiate SaveAs call and Save call in PowerPoint events?

查看:184
本文介绍了如何在PowerPoint事件中区分SaveAs呼叫和Save呼叫?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为PowerPoint 2010写AddIn。我正在使用PowerPoint的两个功能。

I'm writting AddIn for PowerPoint 2010. I'm using two functions of PowerPoint.

Application_PresentationBeforeSave(ByVal Pres As Microsoft.Office.Interop.PowerPoint.Presentation, ByRef Cancel As Boolean)

Application_PresentationSave(ByVal Pres As Microsoft.Office.Interop.PowerPoint.Presentation)

当我在Powerpoint上执行保存操作(Ctrl + S)或SaveAs(文件-> SaveAs)时,它会执行 Application_PresentationBeforeSave()方法。

When I perform Save operation (Ctrl+S) or SaveAs (File -> SaveAs) on powerpoint it executes Application_PresentationBeforeSave() method.

但是我需要区分这两个调用(Ctril + S和SaveAs)并相应地执行一些任务。因此,如何在BeforeSave方法中区分这两个调用?

But I need to differentiate these two calls (Ctril+S & SaveAs) and accordingly perform some task. So how can I differentiate these two calls in BeforeSave method ??

对于Word,在 Application_DocumentBeforeSave(ByVal Doc as Microsoft.Office.Interop。 Word.Document,将ByRef SaveAsUI设置为布尔值,将ByRef取消为布尔值)有SaveAsUI标志,用于区分此方法是由SaveAs还是Ctrl + S操作调用。

As for Word, in Application_DocumentBeforeSave(ByVal Doc As Microsoft.Office.Interop.Word.Document, ByRef SaveAsUI As Boolean, ByRef Cancel As Boolean) there is SaveAsUI flag which differentiate whether this method has been called by SaveAs or Ctrl+S action.

那么在PowerPoint中是否有任何标记/属性可以区分相同的东西?

So is there any flag/property which differtiate same things in PowerPoint ??

推荐答案

感谢Eugene显示我一种方式。
我的问题得到解决。我尝试了您的建议。

Thanks Eugene for showing me a way. My problem got resolve. I tried your suggestion.

这是我的解决方案的说明。
我在Ribbon.xml中添加了函数调用

Here is the description of my solution. I have added function call in Ribbon.xml

在MySaveAs()函数中,我设置了一个glbal变量。并在BeforeSave方法中使用了它。

In MySaveAs() function I set one glbal variable. And used it in BeforeSave mthod.

这篇关于如何在PowerPoint事件中区分SaveAs呼叫和Save呼叫?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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