Hi JP
Thanks for anwering my post.
Unfortunately, It does work. The value of the listbox is not paste into the
"To" field.
"JP" <jp2112@earthlink.net> wrote in message
news:8257a026-c2f4-41da-b90a-ab53a345d6b8@l40g2000pro.googlegroups.com...
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" <cholot...@hotmail.com> 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 " <m...@mvps.org> wrote in
> messagenews:144995k5ko7w3$.1l0q2jn2agb62$.dlg@40tude.net...
>
> > What's your question?
>
> > > > Best regards
> > Michael Bauer
> >
> > >
>
> > 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-