A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to hanlde ListBox double click event



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 5th 08, 10:34 AM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default How to hanlde ListBox double click event

Hi Friends,

I want to handle double click event on ListBox selected item so that it
should get invoked when user double clicked on some item. Also please let me
know how to get which item has been selected.

The following method is not working:

Sub ListBox1_DoubleClick
MsgBox "Double clicked"
End Sub

Thanks,
Paresh

  #2  
Old August 5th 08, 02:41 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to hanlde ListBox double click event

Most controls placed on an Outlook form will only fire one event, even if
they expose additional events in their object model. In the case of a list
box you get the Click() event. If a multi-select list box you don't even get
that.

You read the selected value by looking at the Value property of that
control. You can also handle the Item.CustomPropertyChange() to find when a
bound list box value changes.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
...
Hi Friends,

I want to handle double click event on ListBox selected item so that it
should get invoked when user double clicked on some item. Also please let
me
know how to get which item has been selected.

The following method is not working:

Sub ListBox1_DoubleClick
MsgBox "Double clicked"
End Sub

Thanks,
Paresh


  #3  
Old August 5th 08, 04:07 PM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default How to hanlde ListBox double click event

Ok Ken, I have added one more button to get the selected value. But none of
following working

MsgBox Item.GetInspector.ModifiedFormPages("Find Conference
Room").Controls("ListBox1").Items.Count

MsgBox Item.GetInspector.ModifiedFormPages("Find Conference
Room").Controls("ListBox1").SelectedItem.Value

Could you tell me whats the wrong here.

Thanks,
Paresh

"Ken Slovak - [MVP - Outlook]" wrote:

Most controls placed on an Outlook form will only fire one event, even if
they expose additional events in their object model. In the case of a list
box you get the Click() event. If a multi-select list box you don't even get
that.

You read the selected value by looking at the Value property of that
control. You can also handle the Item.CustomPropertyChange() to find when a
bound list box value changes.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
...
Hi Friends,

I want to handle double click event on ListBox selected item so that it
should get invoked when user double clicked on some item. Also please let
me
know how to get which item has been selected.

The following method is not working:

Sub ListBox1_DoubleClick
MsgBox "Double clicked"
End Sub

Thanks,
Paresh



  #4  
Old August 5th 08, 04:17 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to hanlde ListBox double click event

Considering that a list box from MS Forms doesn't have either a SelectedItem
or Items property I can see why neither would work.

You really want to get in the habit of using the Object Browser in the
Outlook VBA project to see what properties, methods and events are available
on any object you want to use. The forms designer object browser is useless
for that. If you add a reference to MS Forms 2.0 to your Outlook VBA project
references you can then select that library in the VBA Object Browser and
select ListBox and see what's available to you.

The ListBox.List property gives you access to the list of items in the
ListBox. ListBox.Value gives you the selected value, as I mentioned before.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
...
Ok Ken, I have added one more button to get the selected value. But none
of
following working

MsgBox Item.GetInspector.ModifiedFormPages("Find Conference
Room").Controls("ListBox1").Items.Count

MsgBox Item.GetInspector.ModifiedFormPages("Find Conference
Room").Controls("ListBox1").SelectedItem.Value

Could you tell me whats the wrong here.

Thanks,
Paresh


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Messages wont open on double click Adam Bailey Outlook Express 2 March 8th 08 02:09 AM
Open contacts (and calendar) with a double-click gaylin Outlook - Using Contacts 0 September 2nd 07 02:42 AM
double-click or save attachment Steffen Heinzl Add-ins for Outlook 7 November 27th 06 08:21 PM
double click mail item jpspringall Outlook and VBA 2 May 31st 06 10:18 AM
Tasks Not Opening on Double Click Chrispsg Outlook - General Queries 2 February 7th 06 10:47 PM


All times are GMT +1. The time now is 10:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.