Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 4th, 2003, 01:50 PM
Hitchhiker Hitchhiker is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 4 Hitchhiker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old August 29th, 2003, 01:52 AM
jassi jassi is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 jassi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > IdtExtensibility query (Outlook 2000)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway