首先,我尝试使用VB6为OneNote 2010/2013制作一个非常简单的插件。
我为Excel和Word编写了类似的插件,并且删除了所有不必要的插件。
但基本上插件就是Connect.Dsr文件中的插件:
Option Explicit
Dim ONApp As OneNote14.Application
Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
Set ONApp = Application
MsgBox "Conned"
End Sub
Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
MsgBox "DISCONN"
End Sub
我在.dsr文件中做了所有必要的修改,例如:
AppName = "Microsoft OneNote"
AppVer = "Microsoft OneNote 14.0"
LoadName = "Startup"
LoadBehavior = 3
RegLocation = "HKEY_CURRENT_USER\Software\Microsoft\Office\OneNote"
正确操作需要这些。
诀窍如下:当我在VB6 IDE中运行它时,它运行良好。但当我将其编译为.dll时,OneNote COM加载项处理程序表示由于运行时错误,它无法加载插件。
疯了,不是吗?