Declare Function WritePrivateProfileString& Lib _
"kernel32" Alias "WritePrivateProfileStringA" _
(ByVal AppName$, ByVal KeyName$, ByVal _
keydefault$, ByVal FileName$)
Sub AddToINI()
Dim rc As Long
rc = WritePrivateProfileString("Add-Ins32", _
"AddInProject.AddInClass", "0", "VBADDIN.INI")
MsgBox _
"Add-in is now entered in VBADDIN.INI file."
End Sub
既然已经添加了四个事件,再加上以下代码:
Private Sub IDTExtensibility_OnConnection(ByVal _
VBInst As Object, ByVal ConnectMode As _
VBIDE.vbext_ConnectMode, ByVal AddInInst As _
VBIDE.AddIn, custom() As Variant)
MsgBox "Add-in is now connected"
End Sub
Private Sub IDTExtensibility_OnDisconnection(ByVal _
RemoveMode As VBIDE.vbext_DisconnectMode, _
Custom () as Variant)
MsgBox "Add-in is now disconnected"
End Sub
Private Sub IDTExtensibility_OnStartupComplete _
(custom() As Variant)
'增加注释的目的是
'防止过程在编译的时候被删除。
End Sub
Private Sub IDTExtensibility_OnAddInsUpdate _
(custom() As Variant)
'增加注释的目的是
'防止过程在编译的时候被删除。
End Sub