By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 2,010 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

Address EMail from table?

P: n/a
Is there a way to fill the To: box in Outlook using email addresses
from a table?
Dec 14 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Yes.

ShyGuy wrote:
Is there a way to fill the To: box in Outlook using email addresses
from a table?
Dec 14 '06 #2

P: n/a

ShyGuy wrote:
Is there a way to fill the To: box in Outlook using email addresses
from a table?
I'd have thought you'd have seen this before... somewhere you open a
recordset, then you just

olkMsg.To = rsRecipients.Fields("EmailAddress")
etc

look around... Danny Lesandrini has an example at his site
amazecreations.com/datafast

there are examples all over the place here... just search the NG.

Dec 15 '06 #3

P: n/a
On 14 Dec 2006 17:16:28 -0800, pi********@hotmail.com wrote:
>
ShyGuy wrote:
>Is there a way to fill the To: box in Outlook using email addresses
from a table?

I'd have thought you'd have seen this before... somewhere you open a
recordset, then you just

olkMsg.To = rsRecipients.Fields("EmailAddress")
etc

look around... Danny Lesandrini has an example at his site
amazecreations.com/datafast

there are examples all over the place here... just search the NG.

I checked this site but the examples don't seem to do what I need. I
have a form with a list of email addresses. I want to be able to
check any number of these and have Access open and put the checked
names into the send box.
Dec 15 '06 #4

P: n/a

ShyGuy wrote:
On 14 Dec 2006 17:16:28 -0800, pi********@hotmail.com wrote:

ShyGuy wrote:
Is there a way to fill the To: box in Outlook using email addresses
from a table?
I'd have thought you'd have seen this before... somewhere you open a
recordset, then you just

olkMsg.To = rsRecipients.Fields("EmailAddress")
etc

look around... Danny Lesandrini has an example at his site
amazecreations.com/datafast

there are examples all over the place here... just search the NG.


I checked this site but the examples don't seem to do what I need. I
have a form with a list of email addresses. I want to be able to
check any number of these and have Access open and put the checked
names into the send box.
are they separate records? delimited values? (Psychic abilities
failing) How about an example? subform records? The more specific
you are about what you are dealing with, the easier it is to solve your
problem. Basically, you need to grab the individual values (try Split,
maybe?) and then loop through the items in the resulting array and add
them to the Recipients collection. Or could we see your code or could
you describe exactly what your form looks like? (or the form/subform
record sources?)

Dec 15 '06 #5

P: n/a

ShyGuy wrote:
Is there a way to fill the To: box in Outlook using email addresses
from a table?
dim rs as dao.recordset
set rs = dbengine(0)(0).OpenRecordset("tblWithEmail",dbOpen Table)
do until rs.EOF
olkMsg.Recipients.Add rs.Fields("EMailAddress")
rs.MoveNext
loop

rs.close
set rs=nothing
olkMsg.Send

Of course it's missing all the unnecessary guts. the body, the
subject... but that should get you started.

Dec 15 '06 #6

P: n/a
On 14 Dec 2006 19:09:27 -0800, pi********@hotmail.com wrote:
>
ShyGuy wrote:
>On 14 Dec 2006 17:16:28 -0800, pi********@hotmail.com wrote:
>
ShyGuy wrote:
Is there a way to fill the To: box in Outlook using email addresses
from a table?

I'd have thought you'd have seen this before... somewhere you open a
recordset, then you just

olkMsg.To = rsRecipients.Fields("EmailAddress")
etc

look around... Danny Lesandrini has an example at his site
amazecreations.com/datafast

there are examples all over the place here... just search the NG.


I checked this site but the examples don't seem to do what I need. I
have a form with a list of email addresses. I want to be able to
check any number of these and have Access open and put the checked
names into the send box.

are they separate records? delimited values? (Psychic abilities
failing) How about an example? subform records? The more specific
you are about what you are dealing with, the easier it is to solve your
problem. Basically, you need to grab the individual values (try Split,
maybe?) and then loop through the items in the resulting array and add
them to the Recipients collection. Or could we see your code or could
you describe exactly what your form looks like? (or the form/subform
record sources?)

I do apologize. It seems I know so little about Access that I don't
even know how to ask a proper question. ;-(

I have a continuous form that is based on a table. Name, and Email
Address and a check box..

I check the people I want to send the email to and click a button
which changes the control source to a query and the form now shows
only the checked people. All I want to do is place the addresses in
the Send to box in Outlook. I tried looping through the list but all
I get is the first email multiple times.
Dec 15 '06 #7

P: n/a
On 14 Dec 2006 19:13:05 -0800, pi********@hotmail.com wrote:
>
ShyGuy wrote:
>Is there a way to fill the To: box in Outlook using email addresses
from a table?

dim rs as dao.recordset
set rs = dbengine(0)(0).OpenRecordset("tblWithEmail",dbOpen Table)
do until rs.EOF
olkMsg.Recipients.Add rs.Fields("EMailAddress")
rs.MoveNext
loop

rs.close
set rs=nothing
olkMsg.Send

Of course it's missing all the unnecessary guts. the body, the
subject... but that should get you started.

OK! I used this code and was able to copy the checked email addresses
into a text box on my form. I check the boxes I want. run a make
table query and then use your code to read the email addresses from
the table. I can't figure out what the olkMsg line is for and I get
an Object required when I run the code, so I commented it out and it
works. I am thinking it has something to do with Outlook, but don't
know what to do with it.

Thanks for your help. ;-)
Dec 15 '06 #8

P: n/a
OK! I used this code and was able to copy the checked email addresses
into a text box on my form. I check the boxes I want. run a make
table query and then use your code to read the email addresses from
the table. I can't figure out what the olkMsg line is for and I get
an Object required when I run the code, so I commented it out and it
works. I am thinking it has something to do with Outlook, but don't
know what to do with it.

Thanks for your help. ;-)
Oh, if you stuff all the email addresses into a single record, then you
can probably use SendObject. if you use it, (or CDOSYS or whatever),
you don't need Outlook at all.

(olkMsg = Outlook.Message)

Dec 15 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.