Outlook Addin to add custom field to email form or access existing field using C #

I want to access "mailto" - "Field" in Outlook 2007 using Addin and add custom autostart, what is the best way to access this field and add additional information in C #?

Ideas?

Hi

+3
source share
2 answers

In the past, I made a very simple Outlook add-in, and these samples helped me:

http://msdn.microsoft.com/en-us/library/bb226710%28office.12%29.aspx

0
source

Hi, this code will help you ** 1.Set Property

udfSetPropertyG("Mail Status", GlobalVariables.sPaymentClose, mailitem);
     public void udfSetPropertyG(string sPropName, string sPropValue, OutLook.MailItem mailItem)
            {
                OutLook.UserProperty oOlProperty = default(OutLook.UserProperty);
                oOlProperty = mailItem.UserProperties.Add(sPropName, OutLook.OlUserPropertyType.olText);
                if ((oOlProperty == null))
                {
                    oOlProperty = mailItem.UserProperties.Add(sPropName, OutLook.OlUserPropertyType.olText);
                }
                oOlProperty.Value = sPropValue;
            }

2.Paste in the field in Outlook and then send by mail

udsShowUDFields("Mail Status", mailitem);

            public void udsShowUDFields(string sFldName, OutLook.MailItem mailItem)
            {

                var _with1 = oOlApp.ActiveExplorer().CurrentView as OutLook.TableView;
                try
                {

                    if (_with1.ViewType == OutLook.OlViewType.olTableView)
                    {
                        _with1.ViewFields.Add(sFldName);
                        _with1.Apply();
                    }
                }
                catch (Exception ex)
                {
                    _with1.Apply();
                }
            }

3.

 mailitem.Save();
0

Source: https://habr.com/ru/post/1748105/


All Articles