L
Lars Roland
Hi
I have an outlook addin, when outlook shutdown I try to save some tempoary
data from this addin in the register database. I do this in the
OnDisconnection, event that fires before closing outlook.
I have the folowing code:
-------------------------------------------------------------
Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode _
As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
Dim objCB As Office.CommandBar
On Error Resume Next
Set objCB = golApp.ActiveExplorer.CommandBars("myAddin")
regCreate_Key_Value HKEY_CURRENT_USER, modControl.REG_KEY, "leftValue", objCB.Left
regCreate_Key_Value HKEY_CURRENT_USER, modControl.REG_KEY, "topValue", objCB.Top
regCreate_Key_Value HKEY_CURRENT_USER, modControl.REG_KEY, "positionValue", objCB.position
'If UserClosed, then remove the command bar
If RemoveMode = ext_dm_UserClosed Then
Set objCB = golApp.ActiveExplorer.CommandBars("myaddin")
objCB.Delete
End If
'Tear down the class
gBaseClass.UnInitHandler
Set gBaseClass = Nothing
End Sub
-------------------------------------------------------------
the commandbar, I try to save the position of, is created as tempoary, so
I am afraid that I cannot read the position data in the onDisconnection
event.
Is there a method to dalay the destruction of the commandbar so that I
can read these values ?. Another solution would be to place the code
that saves these values in an event that fires at a time where the
commandbar is still intact.
Regards
Lars Roland
I have an outlook addin, when outlook shutdown I try to save some tempoary
data from this addin in the register database. I do this in the
OnDisconnection, event that fires before closing outlook.
I have the folowing code:
-------------------------------------------------------------
Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode _
As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
Dim objCB As Office.CommandBar
On Error Resume Next
Set objCB = golApp.ActiveExplorer.CommandBars("myAddin")
regCreate_Key_Value HKEY_CURRENT_USER, modControl.REG_KEY, "leftValue", objCB.Left
regCreate_Key_Value HKEY_CURRENT_USER, modControl.REG_KEY, "topValue", objCB.Top
regCreate_Key_Value HKEY_CURRENT_USER, modControl.REG_KEY, "positionValue", objCB.position
'If UserClosed, then remove the command bar
If RemoveMode = ext_dm_UserClosed Then
Set objCB = golApp.ActiveExplorer.CommandBars("myaddin")
objCB.Delete
End If
'Tear down the class
gBaseClass.UnInitHandler
Set gBaseClass = Nothing
End Sub
-------------------------------------------------------------
the commandbar, I try to save the position of, is created as tempoary, so
I am afraid that I cannot read the position data in the onDisconnection
event.
Is there a method to dalay the destruction of the commandbar so that I
can read these values ?. Another solution would be to place the code
that saves these values in an event that fires at a time where the
commandbar is still intact.
Regards
Lars Roland