Configuring SharePoint MyCalendar Web Parts to Synchronize with Exchange E-Mail Accounts

SharePoint 2010

Summary: Learn about various collaboration features in Microsoft SharePoint Server 2010, such as how to configure, use, and extend the My Calendar Web Part to synchronize with your corporate Microsoft Exchange email account.


Wrox SharePoint Books

Letzte Änderung: Montag, 9. März 2015

Gilt für: Business Connectivity Services | Exchange Server | Open XML | SharePoint Designer 2010 | SharePoint Foundation 2010 | SharePoint Online | SharePoint Server 2010 | Visual Studio

Inhalt dieses Artikels
Introduction to Collaborative Features in SharePoint Server 2010
Calendars in SharePoint 2010
Adding and Configuring the My Calendar Web Part
Extending the My Calendar Web Part
About the Author
Additional Resources

Applies to: Microsoft SharePoint Server 2010, Microsoft SharePoint Foundation 2010, Microsoft Exchange

Author: Johnny Harbieh

Editors: Wrox Tech Editors for SharePoint 2010 Articles


SharePoint 2010 combines features and tools that enable people and processes to work better together. Team members who are working together on the same project can work and collaborate more efficiently. Table 1 lists some of the collaboration features in SharePoint.

Table 1. Collaboration features in SharePoint Server 2010




Use blog sites to share knowledge and provide guidance to team members and internal or external visitors.


Use discussion lists to create discussion threads and reply to team discussions.


Use wiki sites and pages to quickly add and update content.

Team Sites

Use team sites to share and contribute content.


Use a calendar list to manage corporate or team events.


Use a task list to manage project tasks.


Use workspaces to collaborate offline or online.

The next section discusses how to use calendars on collaborative SharePoint sites.

The list of collaboration features in the preceding section is only a subset. This section discusses how to use one of the features on that list, calendars. SharePoint Foundation 2010 provides the calendars in SharePoint 2010. Calendars are central to most collaborative and departmental team sites.

Imagine that you are involved in a project. Because the project manager must keep track of meetings and deadlines, he or she must have access to calendars, task lists, and so on. The project manager can create a SharePoint site and add a calendar. The calendar can be a team calendar that is stored in SharePoint, or a Calendar that is stored in Exchange but is displayed in SharePoint.

The following are some examples of how teams use calendars on SharePoint sites today.

Example 1: SharePoint Calendar List

Create and manage a calendar list in SharePoint. Team members can view or edit events on the calendar list, depending on their permissions. You can synchronize calendar lists in SharePoint 2010 with an Outlook 2010 calendar. It is a two-way synchronization, which means that when you add or modify events in SharePoint or in Microsoft Outlook 2010, those events appear in both applications after the next synchronization. You can also display multiple calendar lists together on the same page. You can display up to ten calendars, each with a different color, on the same page. For example, you can display two SharePoint calendars together on the same page.

Figure 1. Example SharePoint calendars in overlay mode

SharePoint-Beispielkalender im Überlagerungsmodus

Example 2: My Calendar Web Part on a SharePoint Page

Add a My Calendar Web Part to a SharePoint page to display calendar events that are stored on the computer that is running Microsoft Exchange Server. Individual team members can use the My Calendar Web Part to display their own calendars on their own sites, or you can use the Web Part to display a shared team calendar. For more information, see Adding and Configuring the My Calendar Web Part.

Example 3: Custom Calendar Web Part on a SharePoint Page

Add a custom calendar Web Part to a SharePoint page by extending the My Calendar Web Part and adding custom code.

Example 4: Page Viewer Web Part that Displays a Shared Exchange Calendar

Configure a Page Viewer Web Part to display a shared Exchange calendar on a SharePoint page. The Page Viewer Web Part is basically an HTML IFRAME element that can view a webpage, such as an Microsoft Outlook Web App calendar page, as shown in Figure 2.

Figure 2. Example Page Viewer Web Part showing a Calendar in Outlook Web App

Beispiel für ein Seiten-Viewer-Webpart, das einen Kalender zeigt

Table 2 lists the Web Part properties that are required to display the Exchange calendar.

Table 2. Page Viewer Web Part Properties



Display Type (what you want to show)

Select Web Page (the default setting)


Basic URL Example:

Advanced URL Example: This example shows how to extend the URL to point to a specific account calendar module. For more information about how to use Outlook Web App Web Parts, or for more information about URL formats, see Additional Resources.

Example 5: Group Calendars

Use group calendars in SharePoint 2010 to add resources to a single calendar. Group calendars are a great addition to SharePoint. They are offered as part of the Group Worksite template, and enable project managers to add conference rooms, book resources, or even add people, as shown in Figure 3.

Figure 3. Example Group Calendar

Beispiel für einen Gruppenkalender

These are only some of the many ways that you can use the calendar-specific features in SharePoint.

The next section examines how to add and configure the My Calendar Web Part to display it on a SharePoint page.

Earlier, you learned that the My Calendar Web Part is available in SharePoint Server 2010 Standard edition or SharePoint Server 2010 Enterprise edition, but not available in SharePoint Foundation 2010. The My Calendar Web Part (and several other Web Parts), is available as part of the Outlook Web App Web Parts, as shown in Figure 4.

Figure 4. My Calendar Web Part

"Mein Kalender"-Webpart

The My Calendar Web Part is stored in the Web Part gallery on the site collection level in a file that is named owacalendar.dwp.

To access the Web Part gallery, follow these steps:

  1. Click Site Actions and then click Site Settings.

  2. In the Galleries section, choose Web Parts to display the list of Web Parts available in your SharePoint site collection Web Part gallery (see Figure 5).

Figure 5. My Calendar Web Part in the site collection Web Part gallery

"Mein Kalender"-Webpart im Katalog der Websitesammlung

You can view the Web Part in the gallery, or you can export its XML definition file.

To export the Web Part, follow these steps:

  1. Select the Web Part that is named owacalendar.dwp in the gallery.

  2. In the Documents tab of the ribbon, click View Properties.

  3. Click the name, and if you are prompted, save the file to your desktop. The name of the Web Part is linked to its XML definition file, and its file name extension is .dwp.

If you open the definition file, you see the following XML.

<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns="">
<Assembly>Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<Title>My Calendar</Title>
<Description>Displays your calendar using Outlook Web Access for Microsoft Exchange Server 2003 or later.</Description>

The preceding XML definition file is a My Calendar Web Part that is not configured. You can add this Web Part to your site, configure it, and then export it. If you do this, notice that SharePoint adds more configuration elements to it. New Web Parts built for SharePoint 2010 have a .webpart file name extension instead of a .dwp file name extension. You can open files that have a .dwp file name extension only because of backward compatibility.

Table 3 lists the Web Part main XML elements.

Table 3. OWA calendar definition file main elements




The root element of a Web Part definition file. It encapsulates the rest of the definition.


This is the DLL file or assembly that contains the actual compiled code of the Web Part. This DLL file is loaded into memory by the runtime. This assembly has other namespaces and classes.


This element is what specifies the actual class or implementation of the Web Part. In this case, it is the OWACalendarPart class.

To add and configure the My Calendar Web Part, follow these steps:

  1. Click Site Actions and then click Edit Page.

  2. On the ribbon, select the Insert tab in Page Tools.

  3. Click the Add a Web Part link in the middle of the Web Part zone.

  4. Under the Categories list box, select the Outlook Web App category and choose My Calendar from the Web Parts list that is next to it, as shown in Figure 6.

    Figure 6. Adding My Calendar Web Part to a SharePoint page

    Hinzufügen des "Mein Kalender"-Webparts zu einer SharePoint-Seite
  5. Click Add to add the Web Part to the Web Parts pane on the page.

After the Web Part is added to the Web Parts area on the page, you can configure it.

To configure the Web Part to display your Exchange calendar, follow these steps:

  1. Click the open the tool pane link that is displayed in the middle of the Web Part.

  2. Look at the Web Part properties. In Mail Configuration, do the following:

    1. Type the mail server information. Mail server information is your Outlook Web App endpoint. For example, your URL might be

    2. Type the mailbox information. The email account can be yours or a shared account, but it must be a valid corporate email account such as

    3. Select a daily or weekly view of your calendar, and then click OK.

Figure 7. My Calendar Web Part properties

Eigenschaften des "Mein Kalender"-Webparts

If you are logged on to your network, you should be able to see your calendar without having to sign in again after you perform the preceding steps.

Figure 8. My Calendar Web Part

"Mein Kalender"-Webpart

By default, the My Calendar Web Part does not render in full. You can update the appearance of the Web Part by increasing the value of its Height and Width properties. The mailbox information is optional if you are using the Web Part to view your own calendar. The My Calendar Web Part can translate your credentials, including your email account, and pass that information on to your corporate Exchange server.

The My Calendar Web Part is now ready to use. It is synchronized with your Outlook calendar, and you can display different calendar views, or create or delete an appointment, as shown in Figure 9.

Figure 9. My Calendar Web Part toolbar

Symbolleiste des "Mein Kalender"-Webparts

If you export this Web Part, notice that SharePoint adds several new elements to the Web Part definition file. The following example shows an exported Web Part definition file that has the <Width> element and the <Height> element in addition to the Outlook Web App server root (<OWAServerAddressRoot xmlns="urn:schemas-microsoft-com:owapart">) element and the email address (<MailboxName xmlns="urn:schemas-microsoft-com:owapart">) element that is used during the configuration.

<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns:xsi="" xmlns:xsd="" xmlns="">
  <Title>My Calendar</Title>
  <Description>Displays your calendar using Outlook Web App for Microsoft Exchange Server 2003 or later.</Description>
  <HelpLink />
  <PartImageSmall />
  <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
  <IsIncludedFilter />
  <Assembly>Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
  <MailboxName xmlns="urn:schemas-microsoft-com:owapart"></MailboxName>
  <ViewName xmlns="urn:schemas-microsoft-com:owapart">Daily</ViewName>

You can modify these settings and reimport the Web Part to the Web Part gallery if you want to share your configuration and enable other people to use your Web Part.

The next section explains how to extend the basic functionality of the My Calendar Web Part.

To extend the base functionality of the My Calendar Web Part, you must have access to Visual Studio 2010 to create custom code that can be deployed to your SharePoint site. This section shows how to create a custom Web Part that inherits from the OWACalendarPart class. This class is part of the Microsoft.SharePoint.WebControls namespace, and can be found in the Microsoft.SharePoint.Portal.dll assembly.

To create a custom Web Part class, follow these steps:

  1. Open Visual Studio 2010 as an administrator, and create an Empty SharePoint 2010 Project. Name the project Company.MyCustomCalendarPart, and then click OK.

    Figure 10. Custom My Calendar Web Part SharePoint 2010 Project

    SharePoint-Projekt für benutzerdefiniertes "Mein Kalender"-Webpart
  2. Click the Deploy as a farm solution option and then click Finish.

    Figure 11. Choose Farm solution

    Auswählen der Farmlösung
  3. Right-click your project name in Solution Explorer, click Add, and then click New Item. Choose the Web Part item type. In the Name field, type MyCalendarWebPart and then click Add, as shown in Figure 12.

    Figure 12. Create Web Part SharePoint project item

    Erstellen eines Webpart-SharePoint-Projektelements
  4. Add Microsoft.SharePoint.Portal.dll reference to your project. If your development computer is also your SharePoint server, browse to the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\ folder and select the assembly. If not, copy it from your SharePoint server and place it on your file system.

  5. In the MyCalendarWebPart code file, replace the base class name WebPart with OWACalendarPart.

  6. Add the following using statement at the top of your MyCalendarWebPart.cs file.

    using Microsoft.SharePoint.Portal.WebControls; 

    The using statement enables the Visual Studio compiler and the runtime to resolve the OWACalendarPart class.

  7. Replace the CreateChildControls method and its contents with the following code example, which shows a simple way that you can start to override some of the public members in the OWACalendarPart class. In particular, the code example preconfigures the Web Part so that you and your users don’t have to configure it every time that you add it to a SharePoint page.

    protected override void CreateChildControls()
                //  TODO
                //  Add Your custom code here.
                //  Example overrides.
                //  The Exchange OWA endpoint.
                this.OWAServerAddressRoot = "";
                //  By default, the calendar is the folder this Web Part 
                //  is configured to show.
                //  this.ExchangeFolderName = "Calendar";
                //  There are two View types you can use here. The Daily 
                //  View is the default. Use Weekly instead.
                this.ViewName = "Weekly";
                //  The base part provides the logged-on user email 
                //  account by default. 
                //  this.MailboxName = "";
  8. You must rename the Web Part definition file because the assembly used is Microsoft.SharePoint.Portal, and when SharePoint tries to load Web Parts from that assembly, it requires them to have a definition file that has a .dwp file name instead of a .webpart file name extension. In addition, the .dwp file requires certain XML elements for SharePoint to verify the schema.

    1. Right-click the .webpart file MyCalendarWebPart.webpart, and rename it MyCalendarWebPart.dwp.

    2. Open the MyCalendarWebPart.dwp file and replace its contents with the following code.

      <?xml version="1.0" encoding="utf-8"?>
      <WebPart xmlns="">
        <Assembly>Company.MyCustomCalendarPart, $SharePoint.Project.AssemblyFullName$</Assembly>
          <TypeName>Company.MyCustomCalendarPart.MyCalendarWebPart.MyCalendarWebPart, $SharePoint.Project.AssemblyFullName$</TypeName>
        <Description>My WebPart</Description>

      You must replace the contents of the .dwp file to ensure that SharePoint loads the correct Web Part definition file that contains the Web Part v2 schema information because the functionality in the Web Part relies on the SharePoint Portal namespace.

  9. Double-click the Elements.xml file, and replace its contents with the following code. Notice the .dwp file name extension on the Web Part file. Replacing the original content ensures that you have the correct values in the Path attribute of the File element as well as in the URL. Another option is to take what you must have and replace only those values in the file that you have.

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="" >
      <Module Name="MyCalendarWebPart" List="113" Url="_catalogs/wp">
        <File Path="MyCalendarWebPart\MyCalendarWebPart.dwp" Url="MyCalendarWebPart.dwp" Type="GhostableInLibrary">
          <Property Name="Group" Value="Custom" />
  10. Check your work. Your class, solution, and files should match those shown in Figure 13.

    Figure 13. Custom My Calendar Web Part Solution

    Benutzerdefinierte "Mein Kalender"-Webpartlösung
  11. Save all your work, and then press F5 to start the deployment. Visual Studio 2010 connects to your SharePoint site, and then retracts and deploys your solution. If you are prompted to modify the web.config file to enable debugging, click OK, and then continue, as shown in Figure 14. Visual Studio 2010 opens a new browser window that you can use to navigate to the Web Part gallery and add your Web Part, as shown in Figure 15.

Figure 14. Adding Custom My Calendar Web Part

Hinzufügen des benutzerdefinierten "Mein Kalender"-Webparts

Figure 15. Allow Debugging in Web.Config

Debuggen in Web.Config zulassen

Johnny Harbieh ist ein erfahrener Berater und für Avtex Solutions LLC tätig, einem führenden Microsoft-Partner, der Clientinteraktionen mithilfe von Technologien auf Basis der Microsoft-Plattform optimiert. Als erfahrener Information Worker-Berater konzentriert sich Johnny auf die SharePoint-Plattform und deren Vorteile für die Clients. Seine Arbeit reicht von Strategiebriefings, Planung und Architektur bis hin zur Entwicklung, Bereitstellung und Unterstützung von SharePoint-basierten Lösungen. Johnny verfügt über mehrere Zertifizierungen für .NET, SQL Server und den Portal- und Zusammenarbeitsbereich, einschließlich MCTS und MCITP für SharePoint Foundation und SharePoint Server 2010. Johnny erreichen Sie unter der E-Mail-Adresse oder auf Twitter unter dem Namen @jharbieh. Darüber hinaus unterhält Johnny einen öffentlichen Blog.

The following were tech editors on Microsoft SharePoint 2010 articles from Wrox:

  • Matt Ranlett ist ein SQL Server MVP und war über viele Jahre eine feste Institution der .NET-Entwicklercommunity in Atlanta. Als Gründungsmitglied von Atlanta Dot Net Regular Guys hat Matt mehrere regionale Benutzergruppen gegründet und leitet diese. Nach der Arbeit verbringt er viele Stunden mit lokalen und nationalen Communityaktivitäten, wie beispielsweise der SharePoint 1, 2, 3!-Reihe, der Organisation von drei Codecamps in Atlanta, der Tätigkeit als Vice President of Technology im Vorstand von INETA sowie Auftritten bei mehreren Podcasts wie z. B. .Net Rocks und dem ASP.NET-Podcast. Dennoch fand Matt kürzlich Zeit, sich mit einer wunderbaren Frau namens Kim zu verheiraten, die er bei der Aufzucht von drei riesigen Hunden unterstützt. Matt arbeitet derzeit als Seniorberater für Intellinet und gehört dem Team an, das mithilfe von innovativen Lösungen für den Erfolg von Unternehmen sorgt.

  • Jake Dan Attis. Was Muster, Praxis und Steuerung im Hinblick auf die SharePoint-Entwicklung betrifft, sind Sie bei Jake Dan Attis goldrichtig. Er ist von Moncton, Kanada, in die Region Atlanta gezogen und hat einen Abschluss in angewandter Mathematik, ist aber ein hundertprozentiger SharePoint-Hardcoreentwickler. Normalerweise nimmt Dan an Community-Events in der Region Atlanta teil, hält dort Vorträge oder organisiert derartige Events, wie beispielsweise Codecamps, SharePoint-Samstage und die SharePoint-Benutzergruppe in Atlanta. Wenn Dan einmal nicht in Visual Studio arbeitet, verbringt er gerne Zeit mit seiner Tochter Lily, schaut sich Hockey und Football an und kostet weltweite Biersorten.

  • Kevin Dostalek kann über 15 Jahre Erfahrung in der IT-Branche sowie über 10 Jahre Erfahrung in der Verwaltung großer IT-Projekte und der Führung von IT-Personal aufweisen. Er hat Projekte für Unternehmen ganz unterschiedlicher Größe geleitet und hatte verschiedene Funktionen inne, wie beispielsweise Entwickler, Architekt, Business Analyst, technischer Leiter, Manager Entwicklung, Projektmanager, Programm-Manager und Mentor/Coach. Darüber hinaus hat Kevin zwischen 2005 und 2008 auch als Vice President eine Lösungsbereitstellungsabteilung für einen MS Gold Partner mittlerer Größe geleitet und war später auch als Vice President of Innovation and Education tätig. Anfang 2010 gründete Kevin das Unternehmen Kick Studios, das Beratungs-, Entwicklungs- und Schulungsservices für die Spezialbereiche SharePoint und Social Computing anbietet. Seitdem ist er auch bei zahlreichen Benutzergruppenversammlungen, Treffen und Konferenzen im ganzen Land als Referent aufgetreten. Weitere Informationen zu Kevin finden Sie in seinem Blog "The Kickboard".

  • Larry Riemann verfügt über mehr als 17 Jahre Erfahrung im Entwurf und der Entwicklung von Geschäftsanwendungen für einige der weltweit größten Unternehmen. Larry ist ein unabhängiger Berater, Eigentümer von Indigo Integrations und bietet SharePoint-Beratung ausschließlich über SharePoint911 an. Er ist Autor, veröffentlicht Artikel und hält gelegentlich Vorträge auf Konferenzen. In den letzten Jahren befasste er sich in erster Linie mit SharePoint, dem Entwickeln und Erweitern von über SharePoint hinausgehender Funktionalität. Neben seiner Arbeit an SharePoint ist Larry ein ausgebildeter .NET-Architekt und verfügt über umfangreiches Know-how in Sachen Systemintegration, Unternehmensarchitektur und Hochverfügbarkeitslösungen. Weitere Informationen zu Larry finden Sie in seinem Blog.

  • Sundararajan Narasiman ist ein technischer Architekt bei der Content Management & Portals Group von Cognizant Technology Solutions, Chennai, und verfügt über mehr als 10 Jahre Branchenerfahrung. Sundararajan ist in erster Linie als Architektur- und Technologieberater für die SharePoint Server 2010-Stapel- und Mainstream .NET 3.5-Entwicklung tätig. Er ist ein begeisterter Programmierer und interessiert sich auch für Extremprogrammierung und EDT.