(Solved) – Create an appointment directly in the calendar

(solved)-–-create-an-appointment-directly-in-the-calendar

I want to read an email and convert info in it to an appointment in calendar.The code I use to create appointment is from MSDN and like below.

Sub createmeeting()

 Dim myItem As Object
 Dim myRequiredAttendee, myOptionalAttendee, myResourceAttendee As Outlook.Recipient

 Set myItem = Application.CreateItem(olAppointmentItem)
 'myItem.MeetingStatus = olMeeting
 myItem.Subject = "Strategy Meeting"
 myItem.Location = "Conf Rm All Stars"
 myItem.Start = #3/18/2009 1:30:00 PM#
 myItem.Duration = 90

 Set myResourceAttendee = myItem.Recipients.Add("Ricky Lee")
 myResourceAttendee.Type = olResource
 myItem.Display
 myItem.Save

End Sub 

There are two questions.
1.when I test run it, it create appointment request email,I have to save and close it to add to calendar view, is it possible skip this step and direct add to calendar?
2.for the attendee I need to create myself as attendee in contact, how to skip it if only I will attend.
Thx.

Leave a Reply

Your email address will not be published. Required fields are marked *