![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have create a user form data connect to an ms access db
My ListBox1 shows email address. I would like to double click on a record so that the email value will be paste on my New Email's To field. Thank you all Bre-x |
Ads |
#2
|
|||
|
|||
![]() What's your question? -- Best regards Michael Bauer - MVP Outlook Manage and share your categories: http://www.vboffice.net/product.html?lang=en Am Mon, 15 Mar 2010 15:25:50 -0600 schrieb Bre-x: I have create a user form data connect to an ms access db My ListBox1 shows email address. I would like to double click on a record so that the email value will be paste on my New Email's To field. Thank you all Bre-x |
#3
|
|||
|
|||
![]()
I need the VBA code to put on my listbox double click event.
So that the address will be paste on the "To" box on the new email form. thnks "Michael Bauer [MVP - Outlook]" wrote in message . .. What's your question? -- Best regards Michael Bauer - MVP Outlook Manage and share your categories: http://www.vboffice.net/product.html?lang=en Am Mon, 15 Mar 2010 15:25:50 -0600 schrieb Bre-x: I have create a user form data connect to an ms access db My ListBox1 shows email address. I would like to double click on a record so that the email value will be paste on my New Email's To field. Thank you all Bre-x |
#4
|
|||
|
|||
![]()
In your listbox double click event:
Call CreateEmail(ListBox1.Value) Then somewhere else in your form class: Function CreateEmail(emailAddr As String) Dim Msg As Outlook.MailItem Set Msg = Application.CreateItem(olMailItem) Msg.To = emailAddr End Function Customize as needed. --JP On Mar 16, 9:54*am, "Bre-x" wrote: I need the VBA code to put on my listbox double click event. So that the address will be paste on the "To" box on the new email form. thnks "Michael Bauer [MVP - Outlook]" wrote in messagenews:144995k5ko7w3$.1l0q2jn2agb62$.dlg@40tu de.net... What's your question? -- Best regards Michael Bauer - MVP Outlook *Manage and share your categories: *http://www.vboffice.net/product.html?lang=en Am Mon, 15 Mar 2010 15:25:50 -0600 schrieb Bre-x: I have create a user form data connect to an ms access db My ListBox1 shows email address. I would like to double click on a record so that the email value will be paste on my New Email's To field. Thank you all Bre-x- Hide quoted text - - Show quoted text - |
#5
|
|||
|
|||
![]()
Hi JP
Thanks for anwering my post. Unfortunately, It does work. The value of the listbox is not paste into the "To" field. "JP" wrote in message ... In your listbox double click event: Call CreateEmail(ListBox1.Value) Then somewhere else in your form class: Function CreateEmail(emailAddr As String) Dim Msg As Outlook.MailItem Set Msg = Application.CreateItem(olMailItem) Msg.To = emailAddr End Function Customize as needed. --JP On Mar 16, 9:54 am, "Bre-x" wrote: I need the VBA code to put on my listbox double click event. So that the address will be paste on the "To" box on the new email form. thnks "Michael Bauer [MVP - Outlook]" wrote in messagenews:144995k5ko7w3$.1l0q2jn2agb62$.dlg@40tu de.net... What's your question? -- Best regards Michael Bauer - MVP Outlook Manage and share your categories: http://www.vboffice.net/product.html?lang=en Am Mon, 15 Mar 2010 15:25:50 -0600 schrieb Bre-x: I have create a user form data connect to an ms access db My ListBox1 shows email address. I would like to double click on a record so that the email value will be paste on my New Email's To field. Thank you all Bre-x- Hide quoted text - - Show quoted text - |
#6
|
|||
|
|||
![]()
I assume you meant it does *not* work.
We need more information to diagnose. Where are you putting this code? Can you be more specific than "it doesn't work?" Is the code in the proper place? Is there an error? If so, what is the error code and text of the error message? --JP On Mar 16, 11:19*am, "Bre-x" wrote: Hi JP Thanks for anwering my post. Unfortunately, It does work. The value of the listbox is not paste into the "To" field. "JP" wrote in message ... In your listbox double click event: Call CreateEmail(ListBox1.Value) Then somewhere else in your form class: Function CreateEmail(emailAddr As String) Dim Msg As Outlook.MailItem * Set Msg = Application.CreateItem(olMailItem) * Msg.To = emailAddr End Function Customize as needed. --JP |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
userform in VBAProject.otm not working | Peter Hofman | Outlook and VBA | 1 | June 20th 09 04:17 PM |
Cancel and Reset UserForm and macros | DStrong | Outlook and VBA | 3 | March 6th 09 09:55 PM |
limit to number of controls in a userform? | cinnamngrl | Outlook and VBA | 2 | January 31st 09 06:31 PM |
Launching an UserForm from a cutomised form | Tof | Outlook - Using Forms | 5 | January 9th 07 10:02 PM |
UserForm ShowModal strange behaviour | David OShea | Outlook - Using Forms | 1 | March 14th 06 06:58 PM |