如何了解Outlook 2007数据存储的命名空间 [英] How to understand Namespace of outlook 2007 data store
问题描述
首先,我是Outlook外接程序开发的新生,最近我阅读了MSDN或其他教程中的一些学习资料,首先让我感到困惑的是,如果我想找到某个特定的约会从收件箱中获取strong>或会议请求,我应该首先使用Application.GetNameSpace(MAPI)
获取NameSpace
,而不是获取诸如Folder
或Appointment
Collections之类的某种对象.
Firstly , I am a freshmen to outlook add-in development,Recently I read some learning material from MSDN or other tutorial, The First thing makes me confused is if I want to find something like a certain Appointment or Meeting Request from inbox, I should firstly use Application.GetNameSpace("MAPI")
to get a NameSpace
instead of getting some kind of object like Folder
or Appointment
Collections and so on.
我不了解外接程序开发中的Outlook 2007的数据存储访问模式.我希望有人能帮助我更好地了解Outlook 2007的数据存储访问.
I don't understand the Data Store Access pattern of Outlook 2007 in Add-in development. I hope someone can help me better understand Data store access of outlook 2007.
推荐答案
A MAPI会话 . Application.Session
可与Application.GetNamespace("MAPI")
互换.您可以将会话视为与Outlook数据存储的连接.
A MAPI Session is required to interact with an Outlook Data Store. Application.Session
is interchangeable with Application.GetNamespace("MAPI")
. You can think of a session as a connection to the Outlook Data Store.
要检索约会,可以使用 Namespace.GetDefaultFolder
. /p>
To retrieve appointments, you can use Namespace.GetDefaultFolder
.
Outlook.Folder appointmentStore = Globals.ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar) as Outlook.Folder;
string apptSubject = string.Empty;
foreach (Outlook.AppointmentItem appt in appointments.Items.OfType<Outlook.AppointmentItem>())
apptSubject = appt.Subject;
这篇关于如何了解Outlook 2007数据存储的命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!