Blackberry changing items in the background ... making save fail

  • Thread starter Thread starter marcus.lambert
  • Start date Start date
M

marcus.lambert

Hi

I have a addin dll that I have built using VB6 ontop of outlook 2000

Basically the adding add a tool bar that looks up a field from a data
base and sets it as a user property on the mail item.

As part the setting of the userproperties I call Save.

code snip
------------------------------------------------------------------------------------------------------

Set UserProp = objMailItem.UserProperties.Find("PrincipalFilerUserId")
If UserProp Is Nothing Then
Set UserProp = objMailItem.UserProperties.Add("PrincipalFilerUserId",
olText)
End If
UserProp.Value = project.PrincipalFilerUserId

If objMailItem.Sent Then
objMailItem.Save
End If

-----------------------------------------------------------------------------------------------------------------------

I am having problems though if my user is a blackberry users as it
would seem that when a black berry sync (reconcile???)
it also changes something under the hold and saves the mailitem.

So if the user has the Item open while the blackberry process do it
thing .. I cannot save as the item has changed.

So my question is there a work around to force saving or a smart way
to re-get the reference ? ( I've tried to GetItemFromID)

I guess I need to know more about what blackberry is doing but this
may not be the place for that.

Thanks in advance

m
 
Ok,

Have been trying to work this one a bit more,

Now I detect that the save didn't work (because the item has changed
la la)
So I try to reget the reference via the Entry Id and GetItemFromID the
idea being that this would be a item that can be saved reapply my
changes and attempt to save again but this seem not to work as well!

If I compare (doing and IS ) the objects they are different so I am
assuming that I have pickup the new one or haven't I ? is there a
cache in exchange that give you the same item ? is so how do I release
the first object completely ? I have tryed close etc.

any insight would be greatful !

Marcus
 
Do the items have the same EntryID as before the Blackberry did whatever it
did? If so set all your references to that item to null (Nothing) and that
should release all your references to it after closing it.
 
Ken
Yes this is what I am have been trying to do,

am doing a

objMailItem.Close (olDiscard)
Set objMailItem = Nothing

Then re-getting

Set objNewMailItem =
g_olApp.GetNamespace("Mapi").GetItemFromID(stEntryId)

and then trying to re apply my userproperties and trying to save
again ...

It still fails ... with the same error ?


Marcus
 
Then something else is holding that item open or you have a reference you're
not releasing. If the Blackberry software is holding the item open there's
not much you can do about it.
 
Back
Top