How do I get data from the header by adding a custom field to the mail view list

Add-in Express™ Support Service
That's what is more important than anything else

How do I get data from the header by adding a custom field to the mail view list
 
hundun wds




Posts: 13
Joined: 2020-05-12


        private void AddinModule_OnRegister(object sender, EventArgs e)
        {
            Outlook.NameSpace nameSpace = OutlookApp.GetNamespace("MAPI");

            foreach (Folder folder in nameSpace.Folders)
            {
                TableView view = folder.CurrentView as TableView;

                ViewField field = view.ViewFields.Add("TEST");

                //How do I configure the value displayed by this property here?
                //This property value needs to be retrieved from the message header
            }
        }

Posted 02 Jun, 2020 07:39:09 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Hundun,

Retrieve data from the message headers, create a UserProperty on the email, store data in the UserProperty. Check the Outlook object model on how to use the ViewFields collection; see e.g. https://docs.microsoft.com/en-us/office/vba/api/outlook.viewfields.add.


Andrei Smolin
Add-in Express Team Leader
Posted 02 Jun, 2020 08:55:28 Top