Why don't the buttons get deleted?

J

Johan Christensson

Hi.

I have another problem with a with tha the buttons i create in Outlook, don't get deleted when shuting down Outlook. If I unload the plugin, the buttons disapere as they should, but not when I shutdown and restart Outlook. Then I get a new set of buttons every time, so after a while, there is quite i list.

Any ideas on this?

Best regards, Johan Ch


--------------------------------------------------------------------------------

Private Sub AddinInstance_OnBeginShutdown(custom() As Variant)
On Error Resume Next

' Deletes the buttons created
objCompleteButton.Delete
objTagButton.Delete

' Releases all the variables and object created
Set objHostApp = Nothing
Set objTagButton = Nothing
Set objCompleteButton = Nothing
Set objOrigSub = Nothing
Set objSelMail = Nothing
Set objUserID = Nothing
Set objCommandBars = Nothing
Set objStandardBar = Nothing


End Sub

rivate Sub AddinInstance_OnDisconnection(ByVal RemoveMode As _
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)

On Error Resume Next

If RemoveMode = ext_dm_UserClosed Then
MsgBox "The Add-in was succesfully unloaded."
End If

' Deletes the buttons created on the menu
objTagButton.Delete
objCompleteButton.Delete

' Releases all the variables and object created
Set objHostApp = Nothing
Set objTagButton = Nothing
Set objCompleteButton = Nothing
Set objCommandBars = Nothing
Set objStandardBar = Nothing
Set objOrigSub = Nothing
Set objSelMail = Nothing
Set objUserID = Nothing

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top