What I am trying to do is create an calendar event from mail subject line as below.
If I receive any mail with message body as Due Date:01/01/2015 it should create a event in calendar and also alert me whenever that date and time occurs.
Is this possible by rule or macro? Any help would be much appreciated.
Macro I have tried till now:
Sub CreateAppt(Item As Outlook.MailItem)
Dim newOrder As Outlook.MailItem
Dim thebody As String
Dim date1 As Date
Dim strdate As String
Dim time As String
Dim address As String
Dim TI As Outlook.AppointmentItem
thebody = Item.Body
strdate = Mid(thebody, InStr(1, thebody, "date1: ") + 7, _
InStr(InStr(1, thebody, "date1: "), thebody, vbCrLf) - _
InStr(1, thebody, "date1: ") - 7)
Date = DateSerial(Split(strdate, "/")(2), _
Split(strdate, "/")(1), _
Split(strdate, "/")(0))
time = Mid(thebody, InStr(1, thebody, "time: ") + 5, _
InStr(InStr(1, thebody, "time: "), thebody, vbCrLf) - _
InStr(1, thebody, "time: ") - 5)
address = Mid(thebody, InStr(1, thebody, "address: ") + 7, _
InStr(InStr(1, thebody, "address: "), thebody, vbCrLf) - _
InStr(1, thebody, "address: ") - 7)
Set TI = Application.CreateItem(olAppointmentItem)
With TI
.Subject = Item.Subject
.Location = address
.Start = date1 & time
.Duration = 0
.Body = Item.Body
.ReminderMinutesBeforeStart = 15
.Save
'.Display
End With
End Sub