Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

COM Addin Bug?

Posted on 2000-03-05
10
Medium Priority
?
468 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
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 600 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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…

670 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