View Single Post
  #2  
Old January 25th 06, 05:00 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Automatically convert mail to Calendar item

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...;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

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Daze Ahead" wrote:

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

Ads