Send Mail If Statement

G

Gee

I need to automatically send and email if the subject line is "NOC".

I'm sending from an Access database and what I need is for when the
completed email pops up, to not have to click the "Send" button.

I think it should be some kind of Macro or IF statement in Outlook's VBA?

Thank you in advance for any help you can give me.

Gee
 
J

JP

You should be able to use the MailItem.Send method. Keep in mind this
will not display the email, just send it. Beware the Object Model
Guard.

HTH,
JP
 
G

Gee

Is that instead of "DoCmd.SendObject"?
This is the code I'm using now...what would change please?


If NOC = "300" Then
DoCmd.SendObject acSendReport, "NOCR", acFormatSNP, Me.Text39, , , "NOC
AGING", Me.CallNo, , False
End If
 
J

JP

Sorry, this is the Outlook VBA newsgroup so I assumed you were
instantiating Outlook, not using Access' built in sending commands.
That's the only way I know of where you can send emails without having
to hit Send.

--JP
 
G

Gee

OH, help, HOW do I use the MailItem.Send method and WHERE do I use it? I'm
so confused!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top