Outlook打开工享Calendar
其实……通过Outlook的Application我们是不能直接访问人家的Calendar的。所以我们要绕个圈子去访问它。
[csharp]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;
namespace OutlookAddIn26
{
public partial class Ribbon1
{
private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
{
}
private void button1_Click(object sender, RibbonControlEventArgs e)
{
Outlook.Application objApplication = Globals.ThisAddIn.Application;
Outlook.Explorer objExplorer = objApplication.ActiveExplorer();
Outlook.NavigationPane objNavigationPane = objExplorer.NavigationPane;
if (objNavigationPane.CurrentModule.NavigationModuleType == Outlook.OlNavigationModuleType.olModuleCalendar)
{
Outlook.CalendarModule objCalendarModule = objNavigationPane.Modules.GetNavigationModule(Outlook.OlNavigationModuleType.olModuleCalendar) as Outlook.CalendarModule;
foreach (Outlook.NavigationGroup objNavigationGroup in objCalendarModule.NavigationGroups)
{
foreach (Outlook.NavigationFolder objNavigationFolder in objNavigationGroup.NavigationFolders)
{
if (objNavigationFolder.DisplayName.IndexOf("Bruce Song") >= 0)
{
Outlook.MAPIFolder objTargetCalendar = objNavigationFolder.Folder;
- 发表评论
-
- 最新评论 更多>>