How do I get the mail object in an inline response

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

How do I get the mail object in an inline response
How do I get the mail object in an inline response 
hundun wds




Posts: 13
Joined: 2020-05-12
To ensure that the add-in does not create the view repeatedly, can I create the view in the OnRegister event?Can you give me the simplest example?
Posted 02 Jun, 2020 07:05:41 Top
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:17:03 Top
Andrei Smolin


Add-in Express team


Posts: 17324
Joined: 2006-05-11
hundun wds writes:
//This property value needs to be retrieved from the message header


This won't work. Your only way is to have that data portion in a UserProperty.

hundun wds writes:
//How do I configure the value displayed by this property here?


You were expected to study the ViewFields collection; start from the ViewFields link at https://docs.microsoft.com/en-us/office/vba/api/outlook.tableview.

Also, this coding style doesn't follow our recommendations given in section "Releasing COM objects"; see the manual or here.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 02 Jun, 2020 08:36:43 Top
hundun wds




Posts: 13
Joined: 2020-05-12
Thank you very much for your patience in answering these very basic questions and your guidance
Posted 02 Jun, 2020 09:10:56 Top
Andrei Smolin


Add-in Express team


Posts: 17324
Joined: 2006-05-11
No problem at all.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 02 Jun, 2020 09:17:42 Top