User Property changes show up on the outlook 2013 UI correctly but it does not show up on the MailItem User Properties in Shared Account between PCs Environment

Hello There,
I have written an Outlook Add-In to add several User Properties to our incoming emails. This add-in will be installed in 100 computers in different states and our Exchange server is hosted in our datacenter in CA. 
Everything works great but there is an odd thing happens and that is when one PC changes a UserProperty Value all the other PCs  show up that change on their outlook UIs but when I get the MailItem object from the same other PC is
not showing the changes. But if I shutdown outlook on that PC and open it up again the changes will be showing up in the MailItem object. It seems to me that MailItem doesn't refresh but UI does.
Does anyone know how I can refresh the MailItem after its UserProperties has been changed from another pc in a shared account environment.   
These are my codes to save a property and show all properties:
Public Sub SaveUserProperty(xName As String, xValue As String)
Dim ns As Outlook.NameSpace = Me.Application.GetNamespace("MAPI")
Dim oMailItem As Outlook.MailItem = Nothing
Dim oUserProperties As Outlook.UserProperties = Nothing
Dim oUserProperty As Outlook.UserProperty = Nothing
Try
oMailItem = ns.GetItemFromID(curMailId)
oUserProperties = oMailItem.UserProperties
oUserProperty = oUserProperties.Find(xName)
If oUserProperty IsNot Nothing Then
oUserProperty.Value = xValue
End If
oMailItem.Save()
Catch ex As Exception
MsgBox(String.Format("{0}: {1}{2}", "SaveProperty", vbTab, ex.Message))
Finally
If Not IsNothing(oUserProperty) Then
Marshal.ReleaseComObject(oUserProperty)
oUserProperty = Nothing
End If
If Not IsNothing(oUserProperties) Then
Marshal.ReleaseComObject(oUserProperties)
oUserProperties = Nothing
End If
If Not IsNothing(oMailItem) Then
Marshal.ReleaseComObject(oMailItem)
oMailItem = Nothing
End If
If Not IsNothing(ns) Then
Marshal.ReleaseComObject(ns)
ns = Nothing
End If
End Try
End Sub
Public Sub ShowUserProperties()
Dim builder As StringBuilder = New StringBuilder()
Dim ns As Outlook.NameSpace = Me.Application.GetNamespace("MAPI")
Dim oMailItem As Outlook.MailItem = Nothing
Dim oUserProperties As Outlook.UserProperties = Nothing
Dim oUserProperty As Outlook.UserProperty = Nothing
Try
oMailItem = ns.GetItemFromID(curMailId)
oUserProperties = oMailItem.UserProperties
For Each oUserProperty In oUserProperties
builder.AppendFormat("{2}:{0}{3}{1}", vbTab, vbNewLine, oUserProperty.Name, oUserProperty.Value)
Runtime.InteropServices.Marshal.ReleaseComObject(oUserProperty)
Next
If (builder.Length > 0) Then
System.Windows.Forms.MessageBox.Show(builder.ToString(), "The UserProperties collection")
End If
Catch ex As Exception
MsgBox(String.Format("{0}: {1}{2}", "ShowUserProperties", vbTab, ex.Message))
Finally
If Not IsNothing(oUserProperty) Then
Marshal.ReleaseComObject(oUserProperty)
oUserProperty = Nothing
End If
If Not IsNothing(oUserProperties) Then
Marshal.ReleaseComObject(oUserProperties)
oUserProperties = Nothing
End If
If Not IsNothing(oMailItem) Then
Marshal.ReleaseComObject(oMailItem)
oMailItem = Nothing
End If
If Not IsNothing(ns) Then
Marshal.ReleaseComObject(ns)
ns = Nothing
End If
End Try
End Sub

Outlook will not see the latest changes downloaded from Exchange (or changed through MAPI bypassing the Outlook Object Model on the local machine) until the MailItem object is completely released and reopened. The explorer list shows the changes since it
is fed off the underlying folder contents table, not the cached MailItem object.
There is nothing you can unless you make sure the MailItem object is released and is never kept referenced fro any prolonged periods of time.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!

Similar Messages

Maybe you are looking for

  • Mac Book Pro 2013 Non Retina

    I was looking at the Apple Stores newest Mac Book Pros (later 2013) and I noticed that all the newest Mac Book Pros have Retina. Is there an option to not get Retina with these newer ones? I want to save money on that and also I would liek to get les

  • Tabulation Order in a frame

    I have some JEditorPane in my frame. How can I pass from one to the oder by pression tabulation key? Thx

  • I am getting an error with Backup Assistant

    Everytime it runs it says: "Failed to SyncErrorcode:10". Thanks in advance for your help.

  • ItemDisabled in selectOneMenu

    itemDisabled is not disabling the component in selectOneMenu <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <html> <head> <title>New Component</title> <style> .evenRows {       

  • NWBC is not displaying all the menus

    Hi Experts We are trying to access NWBC using the following link "http://<host>:<port>/sap/bc/nwbc" . NWBC screen is showing up properly but all the menus are not getting displayed. User is having SAP_ALL and SAP_NEW access.What we also discovered th