MS Word 2007 加载项的 LoadBehavior 设置为 2

发布于 2024-09-30 01:44:14 字数 1147 浏览 0 评论 0原文

我有一个 MS Word 插件。我的一位使用 Word 2007 的用户报告说加载项未加载。当她检查 COM 加载项列表时,它显示“加载行为”为“已卸载;启动时加载”(LoadBehavior 注册表项中的值为 2)。

然而,当她检查加载项的注册表项时,LoadBehavior 设置为 3(已加载;启动时加载)。该加载项也根本没有加载。

是否存在某种原因导致 Word 为加载项报告的内容与注册表中的内容之间存在差异,是否有解决方法?

我有预感,加载项崩溃后,Word 在她系统的其他位置设置了 LoadBehavior 值,但她离我很远,并且不希望我远程控制她的计算机来检查自己。

编辑:一些附加信息:如果用户运行宏来检查 Application.COMAddins 中的加载项,则 Connect 设置为 错误。但是,将其更新为 True 似乎没有任何效果。只要 Word 正在运行,该属性就会保持 True,但如果 Word 重新启动,它将恢复为 False(并且加载项永远不会加载)。

更多信息:该加载项因崩溃而被禁用,并被放入禁用的加载项列表中。 用户从 COM 加载项下拉列表中启用了加载项,但加载行为随后停留在 2,尽管注册表值为 3。WinWord.exe 没有任何兼容性设置。

此外,我还提供了三种加载项:一种用于 Word,一种用于 Excel,一种用于 PowerPoint。 Excel 和 PowerPoint 加载项在用户计算机上运行良好。我自己在 XP、Vista 和 7(32 和 64 位)上测试了该加载项。用户使用的是 Vista 32 位。

Word 加载项在用户的计算机上运行了大约两年,但在崩溃后被禁用,并且 LoadBehavior 停留在 2。用户实际上尝试卸载并重新安装 Office,但这并没有改变行为。

解决方案

0xA3 的解决方案并不完整,但方向正确。事实证明,用户安装了一个新的防病毒程序,该程序禁用了该加载项(默默地!::插入关于过度热心的 AV:: 的咆哮)。

我还学到了宝贵的一课:对于某些用户来说,“您是否安装了任何新软件”并不包括防病毒程序。我必须将这个问题改为“您安装了任何新软件或防病毒程序吗?”

I have an add-in for MS Word. One of my users, who is on Word 2007, reports that the add-in is not being loaded. When she checks the COM add-ins list, it says "Load Behavior" is "Unloaded; Load at Startup" (value of 2 in LoadBehavior registry entry).

Yet when she checks the add-in's registry entry, LoadBehavior is set to 3 (Loaded; Load at Startup). The add-in is also not loaded at all.

Is there some reason for the discrepancy between what Word is reporting for the add-in, and what's in the registry, and is there a way to resolve it?

I have a hunch that Word has set a LoadBehavior value somewhere else on her system after the add-in crashed, but she is remote from me, and doesn't want me to remote control her computer to check myself.

Edit: Some additional info: if the user runs a macro to check my add-in in Application.COMAddins, Connect is set to False. However, updating this to True doesn't seem to have any effect. The property will stay True as long as Word is running, but if Word is restarted then it will revert to False (and the add-in is never loaded).

More information: The add-in had been disabled due to a crash, and put in the disabled add-ins list. The user enabled the add-in from the COM add-ins drop-down list, but the load behavior was then stuck on 2, despite the registry value being 3. WinWord.exe doesn't have any compatibility settings.

Also, I provide three add-ins: one for Word, one for Excel, and one for PowerPoint. The Excel and PowerPoint add-ins work fine on the user's computer. I test the add-in myself on XP, Vista, and 7 (32 and 64 bit). The user is on Vista 32 bit.

The Word add-in was working on the user's computer for about two years, but after a crash it was disabled, and the LoadBehavior was stuck on 2. The user actually tried uninstalling and reinstalling Office, but that didn't change the behavior.

Solution

0xA3's solution wasn't complete, but on the right track. It turns out that the user had installed a new antivirus program, which was disabling the add-in (silently! ::insert rant about overzealous AV::).

I also learned a valuable lesson: to some users, "Have you installed any new software" doesn't include antivirus programs. I'll have to change that question to, "Have you installed any new software, or any antivirus programs?"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

放赐 2024-10-07 01:44:14

正如 Otaku 所说,问题似乎是加载项无法加载,因此已断开连接。这可能是由于加载项安装不完整/损坏、依赖项缺失或 COM 组件注册不正确/缺失造成的。

很难为您提供更具体的提示,但这里列出了您可能希望在 Word 启动期间使用的故障排除工具:

  • Sysinternals 中的 DebugView,以管理员身份运行,并使用 Capture Global并启用捕获内核

  • fuslogvw.exe 用于检查缺少的程序集(假设您的加载项是用 .NET 编写的)

  • DependencyWalker 用于查看缺少的本机 dll

  • 进程监视器用于检查丢失的文件/注册表条目

Word 为加载项报告的内容与注册表中的内容之间是否存在差异,是否存在某种原因?是否有解决方法?

注册表与实际 Word 设置之间存在差异的原因很可能是当前加载项状态(已加载,但已断开连接)根本没有存储在注册表中,因为用户没有足够的权限来更改 HKLM 注册表项。 LoadBehavior 在注册表中保留为 3,下次启动 Word 时,Word 将再次尝试加载和连接加载项。

As said by Otaku, the problem seems to be that the add-in cannot be loaded and therefore is disconnected. It might due be an incomplete/corrupt installation of the add-in, a missing dependency or incorrect/missing registration of a COM component.

It's hard to give you more concrete tips, but here is a list of trouble-shooting tools that you might want to use during Word startup:

  • DebugView from Sysinternals, run as Administrator, with Capture Global and Capture Kernel enabled.

  • fuslogvw.exe to check for missing assemblies (assuming your add-in is written in .NET)

  • DependencyWalker to see for missing native dlls

  • Process Monitor to check for missing files/registry entries

Is there some reason for the discrepancy between what Word is reporting for the add-in, and what's in the registry, and is there a way to resolve it?

The reason for the discrepancy between the Registry and the actual Word setting is most likely that the current add-in state (loaded, but disconnected) is not stored in the Registry at all because the user has insufficient permissions to change the HKLM Registry key. The LoadBehavior remains 3 in the Registry, and on next Word startup Word will try again to load and connect the add-in.

眼泪都笑了 2024-10-07 01:44:14

插件可以在用户配置单元或本地机器配置单元中注册,每个配置单元中的文件夹相同。

HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\您的外接程序名称

HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Word\Addins\您的外接程序名称

请务必检查两者。

Addins can be registered in the USER hive or the LOCAL MACHINE hive, same folder in each.

HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\Your addin name

or

HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Word\Addins\Your addin name

be sure to check both.

染墨丶若流云 2024-10-07 01:44:14

仅供参考:我在使用 Excel AddIn 时遇到了类似的问题。由于错误(不一定会生成任何错误消息),Excel 将加载项列入“黑名单”。转到:加载项> “禁用项目”>启用插件为我解决了这个问题。

FYI : I was having similar issue with Excel AddIn. Excel "blacklisted" the add-in due to an error (which has not necessarily generated any error message). Go to: AddIns > "Disabled items" > Enable Addin resovled the issue for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文