接受会议时获取会议时间 [英] Get meeting time when accepting meeting

查看:110
本文介绍了接受会议时获取会议时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检测一个会议项目,这是Outlook中加载项"的一部分.它为用户提供了根据自己的工作量(例如项目,类型等)对会议进行分类的选项,

我正在使用此代码查看ItemSend事件

Application.ItemSend+=Application_ItemSend;

Outlook.MeetingItem m = (Outlook.MeetingItem)Item;
string s = m.Body;

强制转换会出现错误陷阱,以至于每次发送邮件时都不会打扰用户,等等.我尝试了几种组合以获取正确的对象,例如,我可以从其中获取.StartTime .EndTime.

但是,s为Null,我需要获取会议时间和会议正文,简称为

解决方案

您可以使用MeeetingItem.PropertyAccessor.GetProperty访问MAPI属性.对于start属性,DASL属性名称为http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/820D0040.对于结束时间,http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/820E0040.

请记住,这些属性位于UTC时区中,您可以使用MeeetingItem.PropertyAccessor.UtcToLocalTime将其转换为本地时间.

您可以在 OutlookSpy (单击IMessage按钮)中看到可用的MAPI属性及其DASL名称. /p>

I need to detect a meeting item, for part of an Add In in Outlook. It gives the user the option to categorise the meeting for their own workload, i.e. project, type etc, nothing trivial.

I am looking at the ItemSend event, using this code

Application.ItemSend+=Application_ItemSend;

Outlook.MeetingItem m = (Outlook.MeetingItem)Item;
string s = m.Body;

The casting will have error trapping as to not bother the user each time a mail is sent etc. I've tried a few combinations to get the correct object where I can get .StartTime .EndTime eg from.

However, s is Null, I need to get the meeting time and the meeting body, to shorten as a shortname.

解决方案

You can access the MAPI properties using MeeetingItem.PropertyAccessor.GetProperty. For the the start property, the DASL property name http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/820D0040. For the end time, http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/820E0040.

Keep in mind that the properties are in the UTC timezoine, you can convert them to local time using MeeetingItem.PropertyAccessor.UtcToLocalTime.

You can see available MAPI properties and their DASL names in OutlookSpy (click IMessage button).

这篇关于接受会议时获取会议时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆