如何检查Word 2007调用自动保存到Word插件中? [英] How to check that Word 2007 invoke autosave into word addin?

查看:105
本文介绍了如何检查Word 2007调用自动保存到Word插件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在DocumentBeforeSave事件处理程序中具有一些功能.
只有在用户手动调用保存"(按保存"按钮)时,该选项才起作用.
但是word 2007具有自动保存功能,并且每次自动保存工作时都会引发事件DocumentBeforeSave.如何检查保存是通过自动保存调用还是由用户手动调用保存?

I have some functionality inside DocumentBeforeSave event handler.
That's should work only when user manually invoke Save (press Save button).
But word 2007 have autosave function and event DocumentBeforeSave throws each time when autosave work. How to check that save is invoked over Autosave or User manually invoke Save?

推荐答案

似乎没有内置的方法,因为对象模型根本不支持它(每个

It looks like there's no build-in way of doing that because the object model simply doesn't support it (per this link), but you can use VBA to override the default save hotkey and button click, and send those calls to your .NET assembly (per this link). Just make sure you invoke save manually afterwards to make sure the document actually saves.

这篇关于如何检查Word 2007调用自动保存到Word插件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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