我正在开发一个需要对用户的Outlook联系人执行某些处理的应用程序.我正在通过迭代结果来访问Outlook联系人列表MAPIFolder.Items.Restrict(somefilter),可以在其中找到Microsoft.Office.Interop.Outlook.
在我的应用程序中,我的用户需要选择几个联系人来应用某个操作.我想添加一个功能,允许用户从Outlook拖动联系人并将其放在UI中的某个ListBox上(我在WPF中工作,但这可能是更通用的问题).
我是C#和WPF的新手 - 我怎么能:
谢谢
我试图使用以下代码枚举Microsoft.Office.Interop.Outlook.ContactItem对象的属性(让我们称之为ci):
System.Reflection.BindingFlags bf = System.Reflection.BindingFlags.Default;
foreach (System.Reflection.PropertyInfo pi in ci.GetType().GetProperties(bf))
{
Console.WriteLine("Property Info {0}", pi.Name);
}
Run Code Online (Sandbox Code Playgroud)
我实际上尝试了几种BindingFlag值的组合,但是没有返回任何属性.
这就是ContactItem的定义方式:使用System.Runtime.InteropServices;
namespace Microsoft.Office.Interop.Outlook
{
[Guid("00063021-0000-0000-C000-000000000046")]
[CoClass(typeof(ContactItemClass))]
public interface ContactItem : _ContactItem, ItemEvents_10_Event
{
}
}
Run Code Online (Sandbox Code Playgroud)
这就是_ContactItem的定义方式(为简单起见,我只保留了3个道具):
using System;
using System.Runtime.InteropServices;
namespace Microsoft.Office.Interop.Outlook
{
[TypeLibType(4160)]
[Guid("00063021-0000-0000-C000-000000000046")]
public interface _ContactItem
{
[DispId(14848)]
string Account { get; set; }
[DispId(63511)]
Actions Actions { get; }
[DispId(14913)]
DateTime Anniversary { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
有人能帮帮我吗?
提前致谢
短发