如何避免 Word 2007 安全模式?
我正在调试一个 C# 程序,该程序调用 Word 2007 来呈现一些 Office 文件。只要 Word 正常启动和关闭,一切都会正常进行。
在少数情况下,下次 Word 会弹出一条消息。它基本上说它上次没有正确启动,然后询问我是否想在安全模式下启动它。有什么办法可以避免这个弹出消息吗?
I am debugging a C# program that calls Word 2007 for rendering of some office files. It all works well as long as Word starts up and shuts down properly.
In the few instances where it wasn't, there is a pop-up message from Word the next time. It basically says that it wasn't started properly last time and then asks if I would like to start it in Safe-mode. Is there any way of avoiding this popup message?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这里有几种方法:
您真的需要避免安全模式,还是只是对话框?如果您可以使用
/safe
选项启动 Word,那么它将始终处于安全模式,并且不会询问您。你知道是什么原因导致安全模式吗?也许使用
/a
选项启动 Word 来禁用加载项(假设您没有使用任何加载项)可以从一开始就防止崩溃。看看您能否找出导致 Word 认为应该以安全模式打开的原因。必须有一个文件或注册表项使它出错。您可以使用进程监视器来查看它查看的文件和注册表项,并查看常规启动的跟踪和要求安全模式的跟踪之间有哪些不同。然后确保在打开 Word 之前不存在这种情况。
有关命令行选项的列表,请参阅 http://support.microsoft.com/kb/210565对于Word。
There are a few approaches here:
Do you really need to avoid safe mode, or just the dialog? If you can start Word with the
/safe
option then it will always be in safe mode and shouldn't ask you.Do you know what causes safe mode? Maybe starting Word with the
/a
option to disable add-ins (assuming you're not using any) would prevent the cause of the crashing in the first place.See if you can figure out what causes Word to think it should open in safe mode. There has to be a file or registry entry that trips it up. You can use Process Monitor to see what files and registry entries it looks at, and see which ones are different between traces from a regular startup and one where it asks for safe mode. Then make sure that condition doesn't exist just prior to opening Word.
See http://support.microsoft.com/kb/210565 for a list of command line options for Word.
我的 powerpoint 也有同样的问题。我们经营一家剧院,在演出间隙播放幻灯片。如果 powerpoint 因某种原因崩溃或不正常关闭,系统会提示您以安全模式启动。发生的情况是“您想在安全模式下启动powerpoint吗”出现并需要用户干预来修复。我想完全禁用此“功能”或安全模式。我最接近的是以下修复,我现在已经实施了,但我不知道它是否真的会阻止它,直到另一次崩溃(这可能需要几个月的时间才能发生 - 值得庆幸的是)。不过看起来很有希望!
I have the same problem with powerpoint. We run a theatre that does slide shows in between shows. If powerpoint somehow crashes or closes uncleanly, you are prompted to start in safe mode. What happens is that the "do you want to start powerpoint in safe mode" comes up and requires user intervention to fix. I would like to disable this "feature" or safe mode entirely. The closest I have come is the following fix, which I have now implemented but I do not know if it will actually prevent it or not until another crash (which can take months to happen - thankfully). Seems promising though!
最有可能的是,但您必须在诊断层面解决问题,而不是消除症状。
查看使用的代码
Word
本地化代码片段
可能会导致失败
找到特定的解决方案
发现问题
更正问题
不要指望“自动单击”对话框或任何其他此类问题,这是一种黑客行为。
所讨论的代码即使对于提供真正的帮助不是无价的,也是有用的。
Most likely, but you must look to fix the problem at the level of diagnosis, not fire-fight the symptoms away.
Look into the code which utilises
Word
Localise the piece of code which
could cause failure
Find particular solutions to the
found problem
Correct the issue
Don't look to 'auto-click' the dialog away or any other such flakiness, this is a hack.
The code in question would be useful, if not invaluable to providing real help.
我在 .Net 中处理 PowerPoint 时遇到类似的问题,
当我在 PowerPoint 崩溃后从程序启动它时,会显示安全模式消息框,
在对注册表进行一些调查后,它停止了我的自动进程,删除了
HKCU\Software\Microsoft\ Office\15.0\PowerPoint\Resiliency(更改产品和版本)
在启动 Office 程序之前将避免安全模式
(此注册表项存储上次打开文件的信息,通过删除此注册表项,PowerPoint 将不会知道它已崩溃,所以可以正常打开)
I have similar problem dealing with PowerPoint in .Net
the safe-mode message box will show up when I launch it from my program after PowerPoint crashed, which stopped my automatically process
after some investigation into the registry, deleting this
HKCU\Software\Microsoft\Office\15.0\PowerPoint\Resiliency (change the Product and Version)
before starting the Office program will avoid the Safe-mode
(This registry key stores the info of last opened file, by deleting this, PowerPoint won't know it was crashed, so it opens normally)