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!


How to create Exchange Public Folders for Appointments
Created: 04.10.2011
Categories: Exchange Development; Exchange; PowerShell

      Unfortunately the PowerShell cmdlet New-PublicFolder doesn’t allow different types for public folders. But with a small trick you can set the type later. The code requires CDOEX that runs locally only.

      PowerShell Code:
      
      $FolderPath = "/TEMP"
      $NewFolder = "CalendarTest"
      $PFRoot = "file://./backofficestorage/litwareinc.com/Public Folders"

      # Use PowerShell cmdlet to create new folder
      # (depending upon whether a root folder or not)
      if ($FolderPath -ne "")
      {
        $f = $FolderPath -replace("/", "\")
        New-PublicFolder -Name $NewFolder -Path $f
      }
      else
      {
        New-PublicFolder -Name $NewFolder
      }

      # Use ADO to change the folder type
      $o=New-Object -comobject ADODB.Record
      $updated=$false
      $timeout=60
      while (($updated -eq $false) -and ($timeout -gt 0))
      {
        $o.Open($PFRoot + $FolderPath + "/" +
         $NewFolder, "", 3, -1, -1, "", "")
        foreach($item in $o.Fields)
        {
        if($item.Name -eq
          "http://schemas.microsoft.com/exchange/outlookfolderclass")
        {
          $updated=$true
          $item.Value="IPF.Appointment"
        }
      }

      $o.Fields.Update()
      $o.Close()

      if ($updated -eq $false)
      {
      Start-Sleep -s 1
      $timeout --
      }
      }
      

      Tested IPF Types: IPF.Post, IPF.Contact, IPF.Appointment, IPF.Task
      Tested Exchange Version: Exchange 2007
    

Send us a Comment!