|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
IdtExtensibility query (Outlook 2000)
Hi folks,
I'm developing a COM add-in for use with Outlook 2000 and having a bit of difficulty in one area and would greatly appreciate some help. The COM add-in I am developing, creates a new commandbar, containing a drop-down menu and 2 buttons. The create routine works fine and is executed from the OnConnection event within the IDTextensibility interface. The COM add-in commandbar is also correctly deleted from the commandbar collection, when the user unchecks the COM add-in from the Tools>Options>Other>Advanced>COM Addins dialog. This in effect triggers the OnDisconnection event, which correctly runs the applicable delete routine, to delete the commandbar from the commandbar collection, without issue. The problem is that when the OnBeginShutdown event is executed (when the user shuts down Outlook without disconnecting the plugin) for some reason, object references to the applicable commandbar collection are being dropped BEFORE this event completes! This results in an error (#94 - "Object variable or with block variable not set") occuring when a subsequent call to the delete routine references the commandbar collection object and this ultimately leaves the Outlook toolbar with an extra command bar that doesn't work. Does anyone have a sound understanding of the IDTextensibility methods and/or can anyone point me at a working example using the OnConnection and OnBeginShutdown events within the IDTextensibility to create AND delete an additional commandbar within Outlook? Kind Regards Hitch |
|
#2
|
|||
|
|||
|
Hi Hitch,
The cause of ur problem is a bug in Add-in support for some office products. And Microsoft also confirms the same. As per this bug, the commandBar control reference becomes invalid before COM Add-In's OnDisconnection Event Fired. You may also encounter the problem with the global CommandBar control object reference becoming invalid in the OnStartUpComplete and OnBeginShutdown events. The remedy for the problem, use the FindControl method to obtain a new object reference to the CommandBar control i.e. Instead of, btnMsgButton.Delete give, Set btnMsgButton= objApp.CommandBars.FindControl(Tag:="Custom_Command_From_MyAddin") btnMsgButton.Delete Hope this will solve ur problem R!!! Jassi ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > IdtExtensibility query (Outlook 2000) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|