Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Software and Programs A place where you can share links to Windows applications , Adobe , Microsoft , Rapidshare , Megaupload..

Software and Programs Thread, Emailing from Excel After 30 days in Software & Hardware , Games; Hi, I currently have a spreadsheet listing candidates names and information, including a column of dates (column B), of when ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=30002


Reply
LinkBack Thread Tools Display Modes
Emailing from Excel After 30 days
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
17-02-2009, 11:50 AM
 
Hi, I currently have a spreadsheet listing candidates names and information, including a column of dates (column B), of when these people started placements. I am looking to have excel send an email to one specific address, 30 days after the date...

Hi, I currently have a spreadsheet listing candidates names and information, including a column of dates (column B), of when these people started placements. I am looking to have excel send an email to one specific address, 30 days after the date listed to let us know that the manager needs to be contacted. The code I have so far is:

Sub Mail_small_Text_Outlook()
If Cells(b, 1).Value = (Date + 30) Then
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"Placements in red are coming to three month limit"

On Error Resume Next
With OutMail
.To = "email address"
.CC = ""
.BCC = ""
.Subject = "Overdue placement"
.Body = strbody
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End If

End Sub


I originally was able to get the macro to run to send the email every time excel opened but cant seem to tweek it to only get it send when a date is out of the 30 days. At the moment I have also only used B1 as an example, but would like it obviously to run for all of the dates listed in column B.

My only work with macro code is self taught with help from forums such as this so any help is greatly appreciated

Thanks
 
 
 
Reply

Software and Programs Thread, Emailing from Excel After 30 days in Software & Hardware , Games; Hi, I currently have a spreadsheet listing candidates names and information, including a column of dates (column B), of when ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=30002


Bookmarks

Tags
days, emailing, excel


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump