Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-04-06
3
Medium Priority
?
200 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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.
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

618 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