Collaboration-2-Go


Lösungen und Software-Entwicklung im Collaboration Umfeld, insbesondere Microsoft SharePoint, Microsoft Exchange und Microsoft Office.

Support


Mobil: +49 (152) 53 97 78 79
Mail: service@collaboration-2-go.de
Weitere Kontaktmöglichkeiten: Kontaktseite
Dekoration: Köln



Send Meeting Request Using a Shared Mailbox in Outlook Add-In
Created: 02.11.2012
Categories: Exchange Development; Outlook Development

      Change user context in Outlook add-in and send meeting request using a shared mailbox:
      
      try
      {
        // Create new Session
        Outlook.Application outApp = new Microsoft.Office.Interop.
          Outlook.Application();
        Outlook.NameSpace ns = outApp.GetNamespace("MAPI");
        ns.Logon(Type.Missing, Type.Missing, false, true);

        // Change Context
        Outlook.Recipient organizer = ns.CreateRecipient(
          "shared@collaboration-2-go.de");
        organizer.Resolve();

        // Open Shared Calendar
        Outlook.MAPIFolder folder = ns.GetSharedDefaultFolder(
          organizer,
          Microsoft.Office.Interop.Outlook.OlDefaultFolders.
          olFolderCalendar);

        // Create Meeting Request in Shared Folder
        Outlook._AppointmentItem mr =
          (Outlook._AppointmentItem)folder.Items.Add(
          Microsoft.Office.Interop.Outlook.
          OlItemType.olAppointmentItem);
        mr.MeetingStatus = Microsoft.Office.Interop.Outlook.
          OlMeetingStatus.olMeeting;
        mr.Location = "my location";
        Outlook.Recipient recipient = mr.Recipients.Add(
          "user@collaboration-2-go.de");
        recipient.Resolve();
        recipient.Type = (int)Outlook.OlMeetingRecipientType.olRequired;
        mr.Subject = "my subject";
        mr.Start = DateTime.Now.AddHours(1);
        mr.Duration = 60;
        mr.Body = "my meeting request";
        mr.ReminderMinutesBeforeStart = 15;
        mr.ReminderSet = true;

        mr.Save();
        mr.Send();
      }
      catch (Exception ex)
      {
        System.Diagnostics.Debug.WriteLine(ex.ToString());
      }
      

    

Send us a Comment!