S
Stuart Langridge
I'm trying to write an Outlook COM add-in as a Windows Script Component.
AFAICT, to do this I need to implement the IDTExtensibility2 interface,
which means that I need to implement the methods OnConnection,
OnDisconnection, OnAddInsUpdate, OnStartupComplete, and OnBeginShutdown.
I've created a script component and registered it, and then set it as an
Outlook add-in (by adding the appropriate registry keys in
HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\SendAndFile.WSC,
as http://support.microsoft.com/default.aspx?scid=kb;EN-US;238228 dictates.
However, the add-in won't run in Outlook; it appears in the COM Addins
Manager, but when I try to start it (by checking the checkbox next to it and
hitting OK) there is some kind of error: returning to the CAM says (next to
LoadBehaviour) that the add-in was not loaded because a runtime error
occurred. There is no visible error occurring (no dialog boxes or similar).
The code for the script component is below: as you can see, it doesn't *do*
anything at this stage (I'd just like to get it instantiated before I add
functionality). Am I implementing something incorrectly? Is there any way
that I can see *what* the runtime error that is generated when loading the
addin *is*?
Thanks in advance,
Stuart Langridge
Information Architect
Mills & Reeve
<?xml version="1.0"?>
<component>
<?component error="true" debug="true"?>
<registration
description="SendAndFile"
progid="SendAndFile.WSC"
version="1.00"
classid="{8181fc23-cec8-4b4d-85e4-65c55e6d144f}"</registration>
<public>
<method name="OnConnection">
<PARAMETER name="Application"/>
<PARAMETER name="ConnectMode"/>
<PARAMETER name="AddInInst"/>
<PARAMETER name="Custom"/>
</method>
<method name="OnDisconnection">
<PARAMETER name="RemoveMode"/>
<PARAMETER name="Custom"/>
</method>
<method name="OnAddInsUpdate">
</method>
<method name="OnStartupComplete">
</method>
<method name="OnBeginShutdown">
</method>
<method name="display">
</method>
</public>
<script language="VBScript">
<![CDATA[
function OnConnection(Application,ConnectMode,AddInInst,Custom)
'msgbox "hello"
Stop
OnConnection = true
end function
function OnDisconnection(RemoveMode,Custom)
OnDisconnection = true
end function
function OnAddInsUpdate(Custom)
OnAddInsUpdate = true
end function
function OnStartupComplete(Custom)
OnStartupComplete = true
end function
function OnBeginShutdown(Custom)
OnBeginShutdown = true
end function
function display()
display = "Temporary Value"
end function
]]>
</script>
</component>
AFAICT, to do this I need to implement the IDTExtensibility2 interface,
which means that I need to implement the methods OnConnection,
OnDisconnection, OnAddInsUpdate, OnStartupComplete, and OnBeginShutdown.
I've created a script component and registered it, and then set it as an
Outlook add-in (by adding the appropriate registry keys in
HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\SendAndFile.WSC,
as http://support.microsoft.com/default.aspx?scid=kb;EN-US;238228 dictates.
However, the add-in won't run in Outlook; it appears in the COM Addins
Manager, but when I try to start it (by checking the checkbox next to it and
hitting OK) there is some kind of error: returning to the CAM says (next to
LoadBehaviour) that the add-in was not loaded because a runtime error
occurred. There is no visible error occurring (no dialog boxes or similar).
The code for the script component is below: as you can see, it doesn't *do*
anything at this stage (I'd just like to get it instantiated before I add
functionality). Am I implementing something incorrectly? Is there any way
that I can see *what* the runtime error that is generated when loading the
addin *is*?
Thanks in advance,
Stuart Langridge
Information Architect
Mills & Reeve
<?xml version="1.0"?>
<component>
<?component error="true" debug="true"?>
<registration
description="SendAndFile"
progid="SendAndFile.WSC"
version="1.00"
classid="{8181fc23-cec8-4b4d-85e4-65c55e6d144f}"</registration>
<public>
<method name="OnConnection">
<PARAMETER name="Application"/>
<PARAMETER name="ConnectMode"/>
<PARAMETER name="AddInInst"/>
<PARAMETER name="Custom"/>
</method>
<method name="OnDisconnection">
<PARAMETER name="RemoveMode"/>
<PARAMETER name="Custom"/>
</method>
<method name="OnAddInsUpdate">
</method>
<method name="OnStartupComplete">
</method>
<method name="OnBeginShutdown">
</method>
<method name="display">
</method>
</public>
<script language="VBScript">
<![CDATA[
function OnConnection(Application,ConnectMode,AddInInst,Custom)
'msgbox "hello"
Stop
OnConnection = true
end function
function OnDisconnection(RemoveMode,Custom)
OnDisconnection = true
end function
function OnAddInsUpdate(Custom)
OnAddInsUpdate = true
end function
function OnStartupComplete(Custom)
OnStartupComplete = true
end function
function OnBeginShutdown(Custom)
OnBeginShutdown = true
end function
function display()
display = "Temporary Value"
end function
]]>
</script>
</component>