none
Recipients Don't See my UserProperties RRS feed

  • Question

  • Hey,

    I'm writing an add-in in Outlook and added a new form religion to the MeetingItem. I've added a new textbox for the Agenda by:

    Outlook.UserProperty agenda = meeting.UserProperties.Find("Agenda", true);
    if (objectives == null)
    {
          objectives = meeting.UserProperties.Add("Agenda", Outlook.OlUserPropertyType.olText, false, Outlook.OlUserPropertyType.olText);
    }
    agenda.Value = txtAgenda.Text;

    On my outlook - when I open the meetingitem I can see the text in the agenda textbox after loading it with:

    Outlook.UserProperty agenda = meeting.UserProperties.Find("Agenda", true);
    if (agenda != null)
    {
    	txtAgenda.Text = agenda.Value;
    }

    The problem is with the recipients of the meeting request - they have the add-in installed on their computer but when they open the meetingitem they don't see the content of the textbox.

    How can I fix this issue?



    Seif.

    Tuesday, November 19, 2013 2:01 PM

Answers

All replies

  • How do you set the properties?

    Do you see the named properties if you look at the meeting item in the Sent Items folder with OutlookSpy (click IMessage button)?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, November 19, 2013 2:05 PM
  • How do you set the properties?

    Do you see the named properties if you look at the meeting item in the Sent Items folder with OutlookSpy (click IMessage button)?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

     Thank you for your replay. Actually, in the Sent Items I do not see the properties. But, if I send a Cancel for the meeting and check it - I can see them there. I can see them only in the Meeting Cancelled sent item but not in the meeting request.

    What can I do? What's the issue here?


    Seif.

    Tuesday, November 19, 2013 4:02 PM
  • Also if I send an update I can see the UserProperties in the IMessage in OutlookSpy.

    What is the problem here?


    Seif.

    Tuesday, November 19, 2013 4:08 PM
  • How and when do you add the properties? Where does meeting variable come from?

    Keep in mind that the only time you can access the outgoing MeetingItem object is when you process the Application.ItemSend event


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, November 19, 2013 4:12 PM
  • In the Application_ItemSend(object Item, ref bool Cancel) I have:

    public partial class ThisAddIn
        {
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                this.Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
            }
    
            private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
            {
            }
    
    	void Application_ItemSend(object Item, ref bool Cancel)
    	{		
    		Outlook.Inspector insp = Globals.ThisAddIn.Application.ActiveInspector();
    		Outlook.AppointmentItem meeting = insp.CurrentItem as Outlook.AppointmentItem;
    
    		WindowFormRegionCollection formRegions = Globals.FormRegions[Globals.ThisAddIn.Application.ActiveInspector()];
    		System.Windows.Forms.TextBox txtAgenda = formRegions.NewFields.Controls["txtOutcome"] as System.Windows.Forms.TextBox;
    		
    		// save the user properties
    		Outlook.UserProperty objectives = meeting.UserProperties.Find("EMOBJECTIVES", true);
    		if (objectives == null)
    		{
    			objectives = meeting.UserProperties.Add("EMOBJECTIVES", Outlook.OlUserPropertyType.olText, false, Outlook.OlUserPropertyType.olText);
    		}
    		objectives.Value = txtAgenda.Text;
    		meeting.Save();
    	}
    }


    Something wrong with the code? strange how I can see them when I send an update to the meeting or if I send a meeting cancel.


    Seif.


    Tuesday, November 19, 2013 4:18 PM
  • You are not setting the properties on the outgoing MeetingItem object (Item variable). You are setting the properties on the currently displayed AppointmentItem object, which is not being sent, it just stays in the Calendar folder. 

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, November 19, 2013 4:31 PM
  • How can I save it in the Item variable??

    Seif.

    Tuesday, November 19, 2013 4:34 PM
  • Cast the item variable to MeetingItem and use MeetingItem.UserProperties.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by Seif Ibrahim Tuesday, November 19, 2013 7:02 PM
    Tuesday, November 19, 2013 4:46 PM
  • Thanks a lot!!! It works now.. I can see the properties in the Sent Item message.

    Seif.

    Tuesday, November 19, 2013 7:03 PM