How to use SendObject to send to multiple emails but not cc (put in several emails at once...)...?

I have a simple form in an Access db that lets the user put in an email address and then the body in a form, then the send event fires off an email using the SendObject command (using Outlook).

What if the user wanted to be able to put in several emails in a field (comma separated) and hit send, but it would open the Outlook new email for each email, not CC.

So if they put,, and, fill in their body and hit send, three emails would open up (for approval), each to the emails listed above.

How do I do this?

Kevin SmithAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kevin SmithAuthor Commented:
The emails can have different fields if need be...
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
SendObject is not using Outlook per say; your using the MAPI interface that was installed by outlook.

You have two basic choices:

1. Call sendobject multiple times.

2. If you want to see the e-mails in Outlook, then you'll send to control Outlook with automation.  ie.  here's one example:

Sub Mail_Outlook(strSendTo As String, strCC as String, strBCC as string, strSubject as String, strBody as String)

    Dim OutApp As Object
    Dim OutMail As Object

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

   On Error Resume Next

    With OutMail
        .To = strSendTo
        .CC = strCC
        .BCC = strBCC
        .Subject = strSubject
        .Body = strbody
        'You can add a file like this
        '.Attachments.Add ("C:\test.txt")
        .Send   'or use .Display
    End With

    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kevin SmithAuthor Commented:
nothing happens with option there any prep to using it?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Kevin SmithAuthor Commented:
How do I call sendobject multiple times?  I've tried simply putting another sendobject command under the other but it doesn't work...still only opens one.
Kevin SmithAuthor Commented:
Wait, the multiple so opens the emails right after each other...any way possible to get them to all open at once?
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<Wait, the multiple so opens the emails right after each other...any way possible to get them to all open at once? >>

 Yes, I would think so (have never tried it), but I also think your asking for trouble.  If you sent to 100 people, you'd end up with 100 mail items.

 An alternative approach might be to create each of the mail items, save them to the draft older, then display Outlook and the first item from the folder.

  Personally I'd adress the e-mail to myself in the 'to' and then BCC everyone on the e-mail and deal with one mail item object only.

  But that assumes it's the same e-mail for every receipent.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.