Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Send Mail If Statement (http://www.outlookbanter.com/outlook-vba/91697-send-mail-if-statement.html)

Gee June 18th 09 05:07 AM

Send Mail If Statement
 
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

JP[_3_] June 18th 09 07:45 PM

Send Mail If Statement
 
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

On Jun 18, 12:07*am, Gee wrote:
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


Gee June 18th 09 09:38 PM

Send Mail If Statement
 
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

"JP" wrote:

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

On Jun 18, 12:07 am, Gee wrote:
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



Gee June 29th 09 12:31 AM

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

"Gee" wrote:

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

"JP" wrote:

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

On Jun 18, 12:07 am, Gee wrote:
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



JP[_3_] July 1st 09 07:45 PM

Send Mail If Statement
 
See http://www.codeforexcelandoutlook.co...ok-automation/
for sample code.

--JP

On Jun 28, 7:31*pm, Gee wrote:
OH, help, HOW do I use the MailItem.Send method and WHERE do I use it? *I'm
so confused!



"Gee" wrote:
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


"JP" wrote:


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




All times are GMT +1. The time now is 07:57 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com