Last post Jul 21, 2008 10:23 AM by EvilAngel
Jul 08, 2008 03:40 AM|EvilAngel|LINK
Ok, so the code below (in VB.NET - wanted C#.NET instead but what can you do?) automatically creates a meeting appointment in Outlook Calendar. It does exactly what I want. My next question is how do I delete an appointment in Outlook Calendar? Searched
the net and cant find a result.
' Create an Outlook application.
Dim oApp As Outlook.Application = New Outlook.Application()
' Get NameSpace and Logon.
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
oNS.Logon(USERNAME, PASSWORD, False, True) ' TODO:
' Create a new AppointmentItem.
Dim oAppt As Outlook.AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
' Set some common properties.
oAppt.Subject = "Created using OOM in C#"
oAppt.Body = "Hello World"
oAppt.Location = "Samm E"
oAppt.Start = Convert.ToDateTime("10/10/2008 9:00:00 AM")
oAppt.End = Convert.ToDateTime("10/10/2008 1:00:00 PM")
oAppt.ReminderSet = True
oAppt.ReminderMinutesBeforeStart = 5
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy ' olBusy
oAppt.IsOnlineMeeting = False
' Save to Calendar.
' Clean up.
oApp = Nothing
oNS = Nothing
oAppt = Nothing
Jul 11, 2008 07:33 AM|EvilAngel|LINK
Ok, managed to find bits of code in classic ASP which is what I wanted. Put a few pages together to add, list and delete appointments so no worries, all sorted :)
Jul 17, 2008 04:16 AM|Dmxxmd|LINK
Hi Evil Angel, sorry If i am bothering you:) Was just wondering, I saw the email outlook appointment Application code that you have written in the asp.net website blog type of thing:). I wrote the same type of application but now I got this problem, I cannot
create one that cancels the meeting appointment. I have changed the code to OLMeetingCanceled but What It does is if you send it, it makes an duplicate appointment item so in the calendar there will be 2 of the same appointments, and the email message got
a remove from calendar button. If I click on the remove from calendar button It removes the newest one created by the cancelation email. and the original one does not get removed. Please if you have any Idea on how I am going to make that work let me know
on my email address I will really appriciate it, and if there is anything you require dont hesitate to ask me because I will love to help you 2. my email address is : firstname.lastname@example.org Thank you very much
Jul 18, 2008 10:31 AM|EvilAngel|LINK
Got your mails and sent replies. Hope you came right? ;)
Jul 21, 2008 01:53 AM|Dmxxmd|LINK
Hi Evil Angel I didnt get any of your mails, please send them again.
Jul 21, 2008 10:23 AM|EvilAngel|LINK
LOL! Im the one thats been mailing you with the source code back and forth, the 3 files I sent in classic ASP? ;)
For those looking for the solution, posted it on my blog: