C#Outlook加载项获取选定的电子邮件 [英] C# Outlook add-in get selected emails

查看:101
本文介绍了C#Outlook加载项获取选定的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Outlook 2010加载项中获取所有选定的电子邮件.我找到了 MSDN教程,但是我是C#的初学者,但我不太理解以下代码行:Object selObject = this.Application.ActiveExplorer().Selection[3];

I want to get all selected emails in my Outlook 2010 add-in. I found this MSDN tutorial, but I am a beginner at C#, and I don't quite understand this line of code: Object selObject = this.Application.ActiveExplorer().Selection[3];

我相信Selection[]类似于C#中的重写运算符,索引器.但是,有什么办法可以看到它的实现吗?如果我遍历代码,则只会看到接口,而看不到实现.所以我不知道Selection对象的结构. operator []的真正底蕴.

I believe Selection[] is something like overridden operator, indexer in C#. But, is there any way to see implementation of it? If I go through the code, I only see interfaces but not implementations. So I don't know the structure of the Selection object. What is really behind the operator [].

此外,为什么所选项目从索引1开始而不是从0开始?

Also, why do the selected items begin at index 1 and not 0?

推荐答案

该行检索选择的第三条消息.
Selection []等同于Selection.Item()-Item函数被标记为索引属性访问器.
您看不到实现-它全部在Outlook对象模型中.
所有Outlook集合都以1开头,而不是0.这是以前在VB中的用法,因此Outlook对象模型使用相同的约定.

That line retrieves the third selected message.
Selection[] is equivalent to Selection.Item() - Item function is marked as the indexed property accessor.
You cannot see the implementation - it is all in the Outlook Object Model.
All Outlook collections begin with 1, not 0. This is how it used to be in VB, so the Outlook Object Model uses the same convention.

这篇关于C#Outlook加载项获取选定的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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