{{tag>category:"OpenInsight 32-Bit" author:"Karl Pozmann" author:"Warren Auyong"}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== How do I cancel a calendar event? (OpenInsight 32-Bit) ==== === At 01 MAY 2010 12:18:36PM Karl Pozmann wrote: === Used the following handy code from Mr. Carten to create a calendar event. My question is how do I cancel it? I tried setting Status to Cancelled but that causes an Ole Error. More research points out that the UID is no longer used in Outlook 2007 and 2010, which is one of the calendar apps I'm trying to update. Finally, how best to update someone else's calendar (not the one the user is logged into). OI 7.2.2 XP Pro sp3 Function OLE_Calendar_Test() * ---- * Oi version * rjc 03-20-2006 * --- equ true$ to 1 equ false$ to 0 equ olAppointmentItem to 1 Debug objOutlook=OleCreateInstance("Outlook.Application") if OleStatus() then GoTo ErrorHandler objAppointment=OleCallMethod(objOutlook, 'CreateItem', olAppointmentItem) if OleStatus() then GoTo ErrorHandler * Note That -] syntax works for OlePutProperty / OleGetProperty in System Editor, OI 7.2 objAppointment-]Start=05/05/2010 12:00 PM" if OleStatus() then GoTo ErrorHandler objAppointment-]Duration=60 objAppointment-]Subject=Calendar Test Cinco DeMayo!!! CANCELLED" objAppointment-]Body=Meet with Scripting Guys to discuss upcoming plans." objAppointment-]Location=109A" objAppointment-]ReminderMinutesBeforeStart=15 objAppointment-]ReminderSet=True$ *objAppointment-]Status=Cancelled" if OleStatus() then GoTo ErrorHandler x=OleCallMethod(objAppointment, 'Save') if OleStatus() then GoTo ErrorHandler return 0 ErrorHandler: call Set_Status(1, 'Ole_Error ' : oleStatus()) return 1 ---- === At 01 MAY 2010 12:46PM Warren Auyong wrote: === http://msdn.microsoft.com/en-us/library/aa210899%28office.11%29.aspx I see properties for BusyStatus, MeetingStatus, and ResponseStatus MeetingStatus: http://msdn.microsoft.com/en-us/library/aa171486%28v=office.11%29.aspx OlMeetingStatus can be one of these OlMeetingStatus constants. olMeeting olMeetingCanceled olMeetingReceived olNonMeeting If you use VBScript, you do not create the Application object, and you cannot use named constants. This example shows how to perform the same task using VBScript. Sub CommandButton1_Click() Set myItem=Application.CreateItem(1) myItem.MeetingStatus=1 myItem.Subject=Strategy Meeting" myItem.Location=Conference Room B" myItem.Start=#9/24/97 1:30:00 PM# myItem.Duration=90 Set myRequiredAttendee=myItem.Recipients.Add ("Nate Sun") myRequiredAttendee.Type=1 Set myOptionalAttendee=myItem.Recipients.Add ("Kevin Kennedy") myOptionalAttendee.Type=2 Set myResourceAttendee=myItem.Recipients.Add("Conference Room B") myResourceAttendee.Type=3 myItem.Display End Sub So I guess you want to set MeetingStatus to 2 ---- === At 01 MAY 2010 01:03PM Karl Pozmann wrote: === Beautiful! Thanks Warren - I'll give it a shot here shortly! [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=173F95C144BE895385257716005997FC|View this thread on the Works forum...]]