Automatically convert mail to Calendar item

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to push an entry into my Calendar, based on key words in an email.
The mail has standard subject and text body (generated by another system).
e.g. Mail contains..
Component : MSwidget
Release number : 6.0.18
Release type : Maintenance Release
Release status : Planned
Release date : 2006-02-16 12:00:00

How to extract "Release date" and generate a Calendar entry for this day?
The rules Wizard is limited to mail directories. //DJ
 
This can be done, but could prove tricky unless the text in the message body
never wavers from it's format. You may need to play around with my string
logic, but this should be a good start for you. It's setup to be run from a
rule:

How to create a script for the Rules Wizard in Outlook:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q306108

Sub CreateAppointmentFromMessageBody(Item As Outlook.MailItem)

Dim objAppt As Outlook.AppointmentItem
Dim strX() As String, intX As Integer, intY As Integer
Dim strY() As String
Dim dteRelease As Date

strX = Split(Item.Body, Chr(13))
For intX = 0 To UBound(strX)
strY = Split(strX(intX), ":", 2)
For intY = 0 To UBound(strY)
If InStr(strY(intY), "Release date") > 0 Then
dteRelease = strY(intY + 1)
GoTo Continue:
End If
Next
Next

Continue:
Set objAppt = Application.CreateItem(olAppointmentItem)
objAppt.Start = dteRelease
objAppt.Display
Set objAppt = Nothing
End Sub
 
Back
Top