Solved

COM Addin Bug?

Posted on 2000-03-05
10
458 Views
Last Modified: 2012-06-27
I am trying to get an answer from someone whether I have done something wrong, or whether there is a bug in the Outlook COM Addin handling. I have written a com addin and implemented the imspector objects, then problem is, when I close an inspector window using the save and close button or the send button, the Close Event of the inspector object does not get fired. This is a big problem, as this is when I need to free up certain objects. But I have asked newsgroups, microsoft officials and no one has given me an answer. Please help...
0
Comment
Question by:JazC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 2585899
Not sure how you have your code written, but the events will not fire if you just have the 'Dim WithEvents' statements.  Somewhere in your code you must assign an Inspector object the variable defined before you start receiving the notifications.

0
 

Author Comment

by:JazC
ID: 2585919
Well I'm using Delphi to do the code, but the thing is the event fires when you use the x or the close command on the menus, just not when using the buttons that I mentioned. Plus the activate and deactivate events are firing, so i'd say the code I have written is working OK. So really that just leaves a bug... doesn't it?
0
 

Author Comment

by:JazC
ID: 2585924
All the explorer events that i have trapped are working OK also, it really only seems to be the buttons that don't work. Has anyone tried this and either got it working fine, or having the same problem I am?
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 16

Expert Comment

by:Neo_mvps
ID: 2585977
I would definitly say you found something.  Just to confirm w/ you that the same occurs under the OL2K VBA and from VB6.  The 'close' event does not fire when doing a 'send' on a mailitem or selecting 'save and close' on a contact item.
0
 
LVL 16

Accepted Solution

by:
Neo_mvps earned 200 total points
ID: 2586012
I would definitly say you found something.  Just to confirm w/ you that the same occurs under the OL2K VBA and from VB6.  The 'close' event does not fire when doing a 'send' on a mailitem or selecting 'save and close' on a contact item.
0
 

Author Comment

by:JazC
ID: 2586181
I wonder if there is any way around this?
0
 

Author Comment

by:JazC
ID: 2586185
I have tried talking to Darrique Barton(Outlook Program Manager) regarding this but he seems to refuse answering my emails.
0
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 2586231
Haven't found any yet... but have put a word to a couple of contacts to see if there is one.

Just so you know what code I am submitting to them...

Option Explicit

Dim WithEvents mobjInspector As Outlook.Inspector
Dim WithEvents mobjInspectors As Outlook.Inspectors

Private Sub Application_Startup()
  Set mobjInspectors = Application.Inspectors
End Sub

Private Sub mobjInspector_Activate()
  Debug.Print "Activate"
End Sub

Private Sub mobjInspector_Close()
  Debug.Print "Close"
End Sub

Private Sub mobjInspector_Deactivate()
  Debug.Print "Deactivate"
End Sub

Private Sub mobjInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
  Set mobjInspector = Inspector
End Sub

which was tested under the Corp/Workgroup mode of OL2K and Win2K.
0
 
LVL 3

Expert Comment

by:Catalys
ID: 10688838
JazC:

As a workaround, I would declare a module-level variable for a command bar (cmbBar) along with a WithEvent variable for a command bar button (cbbButtom);

When a new inspector is fired and its variable is instantiated, reference its own command bar with cmbBar, then you can trapp which button was used & reference it with cbbButton;

If cbbButton happens to refer to any of the close actions that SHOULD fire the object close event, you can then
call it, e.g.
0
 
LVL 3

Expert Comment

by:Catalys
ID: 10688885
...cont'd (force calling the Inspector Close Event)

If Not (instr(cbbButton.Caption,"Send") + instr(cbbButton, "Save & Close")) then
   mobjInspector_Close
End If

Hope this helps.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AD and Exchnage 2010 Photos 3 51
which is the correct address book to build 4 19
outlook error send and receive 15 97
MS Outlook auto update conflicts 5 29
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question