![]() |
How to create AppointmentItem in inbox (Outlook 2002)
I'm trying to create an AppointmentItem in the Inbox, so the user could
choose if to accept invitation or not, but Outlook 2002 refuses to do so. Anyone knows how to do that? Code sample, C# (doesn't work - keeps a copy in the Draft folder & and places the appointment in the calendar), open Outlook before running this code: using System; using System.IO; using System.Net; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { Outlook.ApplicationClass app = new Outlook.ApplicationClass(); Outlook.NameSpace session = app.GetNamespace("MAPI"); session.Logon(null, null, null, null); Outlook.MAPIFolder inbox = session.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderInbox); Outlook.AppointmentItem item = (Outlook.AppointmentItem)inbox.Items.Add (Outlook.OlItemType.olAppointmentItem); item.Subject = "Subject"; item.Body = "Body"; item.Location = "Location"; item.ReminderSet = false; item.Move(inbox); item.Close(Outlook.OlInspectorClose.olSave); session.Logoff(); } } } |
How to create AppointmentItem in inbox (Outlook 2002)
Instead of an AppointmentItem try MeetingItem.
rog Galois wrote: I'm trying to create an AppointmentItem in the Inbox, so the user could choose if to accept invitation or not, but Outlook 2002 refuses to do so. Anyone knows how to do that? Code sample, C# (doesn't work - keeps a copy in the Draft folder & and places the appointment in the calendar), open Outlook before running this code: using System; using System.IO; using System.Net; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { Outlook.ApplicationClass app = new Outlook.ApplicationClass(); Outlook.NameSpace session = app.GetNamespace("MAPI"); session.Logon(null, null, null, null); Outlook.MAPIFolder inbox = session.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderInbox); Outlook.AppointmentItem item = (Outlook.AppointmentItem)inbox.Items.Add (Outlook.OlItemType.olAppointmentItem); item.Subject = "Subject"; item.Body = "Body"; item.Location = "Location"; item.ReminderSet = false; item.Move(inbox); item.Close(Outlook.OlInspectorClose.olSave); session.Logoff(); } } } |
How to create AppointmentItem in inbox (Outlook 2002)
Even then, a meeting request that has not been sent and received is not going to have Accept and Reject buttons.
Why not create a message with an iCalendar attachment? Or just display the appointment directly to the user without making them open it first? -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Rog" wrote in message ... Instead of an AppointmentItem try MeetingItem. rog Galois wrote: I'm trying to create an AppointmentItem in the Inbox, so the user could choose if to accept invitation or not, but Outlook 2002 refuses to do so. Anyone knows how to do that? Code sample, C# (doesn't work - keeps a copy in the Draft folder & and places the appointment in the calendar), open Outlook before running this code: using System; using System.IO; using System.Net; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { Outlook.ApplicationClass app = new Outlook.ApplicationClass(); Outlook.NameSpace session = app.GetNamespace("MAPI"); session.Logon(null, null, null, null); Outlook.MAPIFolder inbox = session.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderInbox); Outlook.AppointmentItem item = (Outlook.AppointmentItem)inbox.Items.Add (Outlook.OlItemType.olAppointmentItem); item.Subject = "Subject"; item.Body = "Body"; item.Location = "Location"; item.ReminderSet = false; item.Move(inbox); item.Close(Outlook.OlInspectorClose.olSave); session.Logoff(); } } } |
All times are GMT +1. The time now is 01:32 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com