gpt4 book ai didi

c# - 区分 Microsoft Excel 中的保存和自动保存事件

转载 作者:行者123 更新时间:2023-12-04 21:06:48 26 4
gpt4 key购买 nike

我有两个 Microsoft Excel 2007/2010 C# Addin 项目。如何区分用户调用的常规“保存”/“另存为”命令和 Excel 本身定期调用的“自动保存”事件?

我知道在 Microsoft Word 中,我可以通过 Application.WordBasic 访问 AutoSave 事件。目的:

var oBasic = Application.WordBasic;
var fIsAutoSave = oBasic.GetType().InvokeMember("IsAutosaveEvent", BindingFlags.GetProperty, null, oBasic, null);
bool isAutoSave = int.Parse(fIsAutoSave.ToString()) == 1;

最佳答案

通过网络:

There is no Autosave in Excel 2003/2007. The AutoRecovery save is not a true workbook save. It is a save of information, in another file, that apparently only Excel can use to recover from a crash. Users cannot open this file, or at least I haven't been able to.



您可以为正在使用的工作簿关闭自动保存(Excel 2003 - 现在没有打开另一个):
Tools -> Options -> Save

然后滚动你自己的自动保存。

您可能对有关该主题的更多详细信息感兴趣的几个网站:
http://support.microsoft.com/kb/289273

http://social.msdn.microsoft.com/Forums/eu/isvvba/thread/e044e88d-4a8d-4d75-8513-42709f08d0b2

关于c# - 区分 Microsoft Excel 中的保存和自动保存事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13400645/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com