View Single Post
  #3  
Old April 27th 06, 09:01 AM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default 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();
}
}
}

Ads