Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / March 2004

Tip: Looking for answers? Try searching our database.

onDisconnection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lars Roland - 31 Mar 2004 11:28 GMT
Hi I am having problems with my com addin to outlook - it does not use
any Explorer or Inspector, so I think I should be able to do the unloading
inside the onDisconnection.

I have the following four buttons

-------------------------------------------------------
Dim WithEvents previewButton As Office.CommandBarButton
Dim WithEvents reportSpamButton As Office.CommandBarButton
Dim WithEvents reportHamButton As Office.CommandBarButton
Dim WithEvents copyButton As Office.CommandBarButton
-------------------------------------------------------

My onDisconnection sub looks like

-------------------------------------------------------
Dim oOL As Object

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

   'resume on error
   On Error Resume Next

   oOL.CommandBars("Standard").Controls.Item("Copy Message Source to Clipboard").Delete
   oOL.CommandBars("Standard").Controls.Item("Preview Message").Delete
   oOL.CommandBars("Standard").Controls.Item("Report Spam").Delete
   oOL.CommandBars("Standard").Controls.Item("Report Ham").Delete
   Set previewButton = Nothing
   Set reportSpamButton = Nothing
   Set reportHamButton = Nothing
   Set copyButton = Nothing
   Set oOL = Nothing
End Sub
--------------------------------------------------------

I have lookt at the examples at www.microeye.com - but i cannot see why my
code will not unload the buttons.
Ken Slovak - [MVP - Outlook] - 31 Mar 2004 15:21 GMT
Unless Outlook is running with no UI at all there certainly is at least 1
Explorer.

On_Disconnection will *not* fire when the user closes Outlook if any of your
Outlook objects are still instantiated. It will only fire after you release
them all. See the ItemsCB COM addin sample (VB6) on the Resources page at
www.microeye.com for an example of a COM addin template that handles that
and other common Outlook COM addin bugs in a best practices way.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi I am having problems with my com addin to outlook - it does not use
> any Explorer or Inspector, so I think I should be able to do the unloading
[quoted text clipped - 34 lines]
> I have lookt at the examples at www.microeye.com - but i cannot see why my
> code will not unload the buttons.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.