Results 1 to 1 of 1

Thread: delay in closing outlook addin

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2004
    Posts
    4

    delay in closing outlook addin

    Hi,

    I have an outlook addin written in VB.NET
    It puts an extra button in the standard toolbar that will display my custom form when clicked.

    But when I close down outlook, it stays running in the background for a few seconds and then outlook shutsdown.
    It's not that outlook is waiting for my code to close something (I think) because the onBeginShutdown, onDisconnection messages aren't fired earlyer.
    But when I remove the code that adds the button (empty addin) everything goes smoothly.
    So it has something to do in the way I create my button.
    This is how I do it:
    Code:
    private objCBar As Microsoft.Office.Core.CommandBar
    private formButton As Microsoft.Office.Core.CommandBarButton
    
    ...
    
    Public Sub OnStartupComplete(...)
    Try
         formButton = applicationObject.ActiveExplorer.CommandBars.Item("Standard").Controls.Add(Temporary:=True)
         With formButton
             .Caption = "my form"
             .TooltipText = "open my form"
             .Visible = True
         End With
         AddHandler formButton.Click, AddressOf CustomFormButton_Click
    Catch ex As Exception
         MsgBox(ex.Message, MsgBoxStyle.Critical, "Custom form addin Exception")
    End Try
    
    
    Public Sub OnBeginShutdown(...)
         'clean up
         objCBar = Nothing
         formButton = Nothing
    End Sub
    I'm not getting any exceptions (code runs fine) it's just slow when closing outlook.
    Am I forgetting to close something?

    Thanks,

    --maes
    Last edited by maes; Feb 3rd, 2005 at 04:00 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width