none
Why I couldn’t get the values of AppointmentItem.Resources when Meeting Invite is opened and kept idle for certain duration? RRS feed

  • Question

  • Steps

    1. Created a meeting through outlook Add-in which is custom add-in
    2. Assigned selected resources (Conference Room) name in AppointmentItem.Resources and AppointmentItem.Locations.
    3. Meeting invite is sent
    4. Opened the same Meeting Invite through custom Add-in and kept idle for some times, say 5 minutes and closed the Meeting Invite
    5. Re-open the same Meeting Invite through Add-in, the AppointmentItem.Resources doesn’t have resources value but AppointmentItem.Location has the values.
    6. If I close and re-open the outlook again that time I could be able to see the resources values in AppointmentItem.Resources.

    Add-in behaves same in all outlook versions 2007, 2010 and 2013.

    Monday, March 9, 2015 12:47 PM

Answers

  • Hello Kavitha,

    > If I close and re-open the outlook again that time I could be able to see the resources values in AppointmentItem.Resources.

    Most probably you don't release underlying COM objects instantly in the code. Use System.Runtime.InteropServices.Marshal.ReleaseComObject to release an Outlook object when you have finished using it. Then set a variable to Nothing in Visual Basic (null in C#) to release the reference to the object. You can read more about that in the  Systematically Releasing Objects article.

    Don't hold the reference to the item in the code. Instead, you may consider getting an instance of Outlook items using the EntryID value when required. The GetItemFromID method of the Namespace class returns a Microsoft Outlook item identified by the specified entry ID (if valid).

    Monday, March 9, 2015 1:01 PM