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

Userform



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 15th 10, 10:25 PM posted to microsoft.public.outlook.program_vba
Bre-x[_2_]
external usenet poster
 
Posts: 6
Default Userform

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  
Old March 16th 10, 09:51 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Userform



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  
Old March 16th 10, 02:54 PM posted to microsoft.public.outlook.program_vba
Bre-x[_2_]
external usenet poster
 
Posts: 6
Default Userform

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  
Old March 16th 10, 03:42 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Userform

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  
Old March 16th 10, 04:19 PM posted to microsoft.public.outlook.program_vba
Bre-x[_2_]
external usenet poster
 
Posts: 6
Default Userform

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  
Old March 18th 10, 04:38 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Userform

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


All times are GMT +1. The time now is 08:53 PM.


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.