次のコードを使用して、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);
}
実際に BindingFlag 値の組み合わせをいくつか試しましたが、プロパティが返されませんでした。
ContactItem の定義方法は次のとおりです。
namespace Microsoft.Office.Interop.Outlook
{
[Guid("00063021-0000-0000-C000-000000000046")]
[CoClass(typeof(ContactItemClass))]
public interface ContactItem : _ContactItem, ItemEvents_10_Event
{
}
}
これが _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; }
}
}
誰か助けてくれませんか?
前もって感謝します
ボブ