Solved

Capture double-click in Outlook add-in (in Visual Basic 6)

Posted on 2007-04-06
3
197 Views
Last Modified: 2010-04-30
Hi there,

I've written an add-in in Visual Basic 6 which adds a button to Outlook which
does things when it's clicked.
I've been told it would be nice if the button did something else
when the button is double-clicked.
Is there a way for an outlook button to capture a double click ?

Thanks in advance, here's my code.


Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal _
  ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
  ByVal AddInInst As Object, custom() As Variant)
   
    On Error GoTo error_handler_OnConnection

    Set appOutlook = Application

    Dim LB_found As Boolean
    LB_found = False
   
    Dim LO_tmp As CommandBarControl
    For Each LO_tmp In appOutlook.ActiveExplorer.CommandBars("Standard").Controls
        If LO_tmp.DescriptionText = my_description_text Then
            Set my_button = LO_tmp
            LB_found = True
        End If
    Next

    If Not LB_found Then
        Set my_button = appOutlook.ActiveExplorer.CommandBars("Standard").Controls.Add(msoControlButton, Temporary:=True)
        my_button.Caption = LoadResString(TEXT_CALL)
        my_button.FaceId = 275
        my_button.DescriptionText = my_description_text
        my_button.Style = msoButtonIconAndCaption
        my_button.ToolTipText = LoadResString(TEXT_CALL_WITH_9_PASS)
        my_button.OnAction = "!<Addin_29032007.Connect>"
        my_button.BeginGroup = True
    End If

    Exit Sub
   
error_handler_OnConnection:
   
    MsgBox Err.Description
   
End Sub
0
Comment
Question by:B_B_Boris
[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
3 Comments
 
LVL 4

Accepted Solution

by:
quiklearner earned 500 total points
ID: 18865413
Since Outlook doesn't offer that event, you'd need to write the code yourself to handle it..  I would:

1) create a timer in which i would move the current click code out of the click and move to the timer.  I would also add a timer.enable = false to the end of the timer event
2) within the initialization code set the timer's interval to the current users interval (registry HKCurrentUser\Control Panel\Mouse\DoubleClickSpeed
3) make sure the timer is disabled by default
4) within the click event, check to see if the timer is enabled.  If it is, disable it and run your double click code.  If it is not enable the timer..


Bingo, your own double click event!!!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 18867940
quicklearner,

Very clever!
0
 

Author Comment

by:B_B_Boris
ID: 18881692
Thanks for your answer, quicklearner, it's clever indeed.
And the idea is quite simple, once you've understood it.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Mailbox Overload?
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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: …

717 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