How to use microsoft office 2003 calendar how to#
Here, I show you how to create recurring appointment as well as how to set a reminder in Outlook.Ĭreating a recurring appointment is a bit more involved than you might think it would be. This sample kills two birds with one stone.
How to create a recurring appointment (as a reminder) Then we set a few properties and save it. If apptItem IsNot Nothing Then Marshal.ReleaseComObject(apptItem)įirst we use the CreateItem method to create the AppointmentItem. Here is how it’s done: Friend Sub CreateAppointment(title As String)ĭim apptItem As Outlook.AppointmentItem = Nothing
How to use microsoft office 2003 calendar code#
I stated previously that you can only create AppointmentItems with code (and that you can’t create MeetingItems)… and it’s true. This strategy helps ensure you access only the item types you want… reducing the potential for error. Using the message class, you quickly filter a folder’s items to the objects you desire. Okay, this is a somewhat lame except that it makes a nice segue into informing you of the different message classes in play when working with the calendars. If calendar IsNot Nothing Then Marshal.ReleaseComObject(calendar) If calendarItems IsNot Nothing Then Marshal.ReleaseComObject(calendarItems) )Įlse 'MeetingItem (are assume that is the case)Ĭonsole.WriteLine(calendarItems.MessageClass) VB.NET code example Friend Sub EnumerateDefaultAppointmentsAndDoSomethingSillyThatIllustratesAPoint( _ĭim calendar As Outlook.Folder = Nothing Dim calendarItems As Outlook.Items The code loops through the folder’s items collection and prints out its message class. To make this happen, we’ll work with Outlook appointments residing in the default calendar. I thought of you, my fellow developer, and I want you to steal this code. In fact, I daresay they are not lame at all as they can be quite useful. I have a few code samples that show the basics of Outlook calendars but also aren’t too lame.
An AppointmentItem does not contain a MeetingItem… even if you add another user to it.A MeetingItem contains an AppointmentItem.Once sent, the AppointmentItem travels the Interweb is magically turned into a MeetingItem by the time the intended recipient receives it. An AppointmentItem can become a meeting by adding another person to it and clicking Send.Now, here are some mind-blowing facts about these two objects: It resides in the inbox… tricky! You cannot create these with code, but you can code against them when they exist. MeetingItem :: this is a meeting request received by the user.AppointmentItem :: this is the appointment object that resides in a calendar folder.When it comes to the calendar we have two items to master: Outlook likes to mix things up and use different objects for different purposes (e.g.