Modifying an open appointment

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

Modifying an open appointment
 
Rick Koch




Posts: 172
Joined: 2006-09-05
I'm using the VSTO 2005 product.

I've got matching toolbar buttons in my explorer and my appointment inspector. They both call the same method; the explorer passes the selected item and the inspector passes its current item. If the user clicks the buttons, the code should record appointment details to an external system, make a notation in the body text, and add a userproperty with a GUID that refers to the new record in the external system.

If I use the button from the explorer with the appointment closed, the process works correctly. I can inspect the record as the changes are saved, and if I run any other processes against the record I can see the GUID in the specified userproperty.

But if I click the button on the inspector, the behavior is different. I can trace the code all the way through, and everything seems to work the same. As I make the final save to commit my changes, in the ItemChange event I can even see the values I've saved. The text annotation in the body is clearly visible in the inspector. In fact, everything seems normal...until I close the inspector.

Whether I hit "Save and Close" or simply close the window, my userproperty is lost when I close the inspector. Note that there is no event to indicate that this is happening, my userproperty changes are simply "lost," or "rolled back." Note that my body edits are retained; only the userproperty is lost, although if I reopen the inspector and go to close it, it will prompt me to save changes -- presumably the changes from the button event.

Note also that this only happens when working with existing saved appointments. The same method can be called on new appointments, and I have not seen this behavior in that case though I have not tested it enough to guarantee that there are no issues when working with new items.

Any ideas?

Edit: A friend of mine has tested this, outside of VSTO and without Addin Express, and as far as he can tell the properties are being saved correctly for him.

Additional Edit: I've tested this from the inspector, and if I do an Inspector.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olSave) before making my changes, then the changes seem to "take." What do you think?
Posted 09 Feb, 2007 12:01:28 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Rick.

Do you call the Save() method of the Outlook._AppointmentItem interface after you change the item?


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 09 Feb, 2007 17:58:49 Top
Rick Koch




Posts: 172
Joined: 2006-09-05
I do an AppointmentItem.Save() after adding the prop. This results in an ItemChange event, and during this event the property can be seen on the item. It will be there on subsequent operations as long as the inspector remains open, but once I close the inspector the property disappears. I do not see any events being called during the close.

Everything works fine if I do a Close() on the button event before adding the property.
Posted 09 Feb, 2007 22:48:19 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Rick.

To speed up the process, could you please send me the code? I will test it and will try to help.
Posted 12 Feb, 2007 14:33:27 Top
Rick Koch




Posts: 172
Joined: 2006-09-05
I can't send the whole thing. I'm trying to duplicate the problem in a smaller example, but naturally it works in the examples...

I will keep trying.
Posted 12 Feb, 2007 16:59:58 Top