Hot to get propetyInfo of Microsoft.Office.Interop.Outlook.MailIte

J

Jongmin

Hi all,

I am trying to get propertyInfo of mailItem by the following codes.
However, there is no received properties.
myPropertyInfo's length is always zero.

Is there anybody who can give some information about this issue?

/* ========================================== */
Outlook.Application myApp = new Outlook.ApplicationClass();
Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
Outlook.MAPIFolder myInbox
= mapiNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

Type t = typeof(Outlook.MailItem);
PropertyInfo[] myPropertyInfo = t.GetProperties();
foreach (PropertyInfo pInfo in myPropertyInfo)
this.lbxProperties.Items.Add(pInfo.Name);
 
K

Ken Slovak - [MVP - Outlook]

That won't work with Outlook item properties at all, even if you use the
overload and specify binding flags.

What you should do is create a dummy mail item, get its ItemProperties
collection, and iterate that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top