Userform

Status
Not open for further replies.
B

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
 
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
 
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 " <mb@mvps.org> wrote in message

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


 
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-


 
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" <cholot...@hotmail.com> 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" <jp2...@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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
R Adding Userform Dropdown List items from names of subfolders on network drive Outlook VBA and Custom Forms 10
A Outlook Userform Size Outlook VBA and Custom Forms 2
N Activity Tracking with Userform Outlook VBA and Custom Forms 4
D Next Available Meeting with Userform Variables Outlook VBA and Custom Forms 1
A Populate Excel from Outlook Userform Outlook VBA and Custom Forms 3
B Insert Hyperlinks for attachments in Userform Outlook VBA and Custom Forms 5
D Change sender name outlook vba 2010 Custom Userform Outlook VBA and Custom Forms 1
A Open CHM file from VBA Userform Outlook VBA and Custom Forms 4
L Outlook 2007 - Userform Using Outlook 2
A Focus on the userform Outlook VBA and Custom Forms 15
F Outlook 2010 - outlook userform and combo boxes Using Outlook 9
L Userform Field Month and Date. Using Outlook 19
Witzker insert Date & Time (HH:mm) no (ss) in userform Using Outlook 6
A insert Date & Time in userform Using Outlook 3
X VBA: Confused with variables between ThisOutlookSession and UserForm Using Outlook 1
L UserForm Code For Contact Links Using Outlook 76
M Progrescreas Bar in Outlook UserForm Using Outlook 1
C UserForm and ordering variables Outlook VBA and Custom Forms 3
J userform combobox Outlook VBA and Custom Forms 1
R combobox list in userform Outlook VBA and Custom Forms 1
W Using Excel UserForm from Open Workbook in Outlook VBA Outlook VBA and Custom Forms 5
P userform in VBAProject.otm not working Outlook VBA and Custom Forms 1

Similar threads

Back
Top