Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ,
I Created Addin in VSTO there is on problem can you please help me for this,the Problem is i created separate region in Appointment there i added two drop-down and i want to send the selected drop-down value with that region at receiver side i also install this addin on there system but the drop-down value is not getting what i selected here.
Can you please help me on this.#VSTO ,#csharp
I am using outlook 16 and VSTO addin.

What I have tried:

C#
private void ItemSend_Send(object Item, ref bool Cancel)
        {
            try
            {
                Outlook.UserProperty _activityTrackertyoe = app_Item.UserProperties.Add("ActivityTrackerType", Outlook.OlUserPropertyType.olText,true, 1);
                _activityTrackertyoe.Value = ActivityTrackerType.Text;
                Outlook.UserProperty _subType = app_Item.UserProperties.Add("ActivityTrackerSubType", Outlook.OlUserPropertyType.olText,true, 1);
                _subType.Value = ActivityTrackerSubType.Text;
                app_Item.Body = ActivityTrackerType.Text + "<<<->>>>" + ActivityTrackerSubType.Text;
                app_Item.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-{ActivityTrackerType}", ActivityTrackerType.Text);
                app_Item.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-{ActivityTrackerSubType}", ActivityTrackerSubType.Text);
                app_Item.Save();
             
             
                //var myPages =   app_Item.GetInspector.ModifiedFormPages;
                //var myCtrl1 = myPages("ActivityTracker").Controls("ActivityTrackerType");
                //var  myCtrl2 = myPages("ActivityTracker").Controls("ActivityTrackerSubType");
                //myCtrl1.Enabled = true;
                //myCtrl1.Value = ActivityTrackerType.Text;
                //myCtrl2.Enabled = true;
                //myCtrl2.Value = ActivityTrackerSubType.Text;
                app_Item.Display();
                app_Item.Send();
                MessageBox.Show("Sent"+ _activityTrackertyoe.Value+"sub"+ _subType.Value);
            }
            catch (Exception)
            {
                throw;
            }
        
        }
Posted
Updated 2-Oct-19 20:40pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900