create appointment from email

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

Guest

Please can someone help me with this. I am trying to create a calendar
appointment from an email using rules. Does anyone have an example piece of
code that does this or is close to this please.
 
Can you be more specific with what this appointment should contain? Do you
want to use the "Run a Script" action with your rule to run your VBA code?

FYI, to create an appointment:

Set myItem = myOlApp.CreateItem(olAppointmentItem)
 
sorry that was a weak question. Let me start again.

I have email messages which arrive in my inbox which I want to create a rule
to run an external application vbs script which will find the start and end
date and time contained in the message and create an appointment on my
calendar.

START: dd-mmm-yyyy hh:mm
END: dd-mmm-yyyy hh:mm

with the same subject details as contained by the message. I then need to
copy the content of the message into the notes for the appointment.

To be honest I thought this would have been done by someone before and all I
needed to do was copy the code to use it.

Regards,

Mark.
 
This isn't terribly hard to do if you take a look at the Outlook VBA Help
file. First off, you can fire a macro with a rule:

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

You don't need to have your code in a vbs file - write it as Outlook VBA
code. The sample from help below should get you started. You can pass the
Item.Body property derived from the Item object passed in the
CustomMailMessageRule procedure to the AppointmentItem.Body property. You
just need to write some custom logic to parse Item.Body to find the meeting
details.

Sub ScheduleMeeting()
Dim myOlApp As Outlook.Application
Dim myItem as Outlook.AppointmentItem
Dim myRequiredAttendee As Outlook.Recipient
Dim myOptionalAttendee As Outlook.Recipient
Dim myResourceAttendee As Outlook.Recipient
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olAppointmentItem)
myItem.MeetingStatus = olMeeting
myItem.Subject = "Strategy Meeting"
myItem.Location = "Conference Room B"
myItem.Start = #9/24/2003 1:30:00 PM#
myItem.Duration = 90
Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun")
myRequiredAttendee.Type = olRequired
Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy")
myOptionalAttendee.Type = olOptional
Set myResourceAttendee = myItem.Recipients.Add("Conference Room B")
myResourceAttendee.Type = olResource
myItem.Send
End Sub

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
Thanks eric,

That gives me the structure for the appointment. Can you give me a clue to
how to extract the subject from the message that just came in, and what
commands to find and say extract say the START: date and time from the
message. Sorry to ask this but I think you guessed im not a programmer!

Regards,

Mark.
 
Hey Eric,

I actually want to do something a little different, but similar in some
ways. I want to use a rule to automatically parse out data in an
incoming email, and stuff the values into an Access table. Any
suggestions as to where I would look to do that?

grep
 
You have to do the same thing the KB article describes. You still need to
write your own logic to parse the message data though.
 
Back
Top