Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Blackberry changing items in the background ... making save fail

Geek News

Blackberry changing items in the background ... making save fail
"marcus.lambert[ at ]gmail.com" <marcus.lambert[ at ]gmail.com> 2/21/2007 6:58:18 PM
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

Re: Blackberry changing items in the background ... making save fail
"marcus.lambert[ at ]gmail.com" <marcus.lambert[ at ]gmail.com> 2/27/2007 11:57:00 AM
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




Re: Blackberry changing items in the background ... making save fail
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 2/27/2007 3:22:46 PM
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 Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


<marcus.lambert[ at ]gmail.com> wrote in message
news:1172577420.880620.7100[ at ]t69g2000cwt.googlegroups.com...
[Quoted Text]
> 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
>
>
>
>

Re: Blackberry changing items in the background ... making save fail
"marcus.lambert[ at ]gmail.com" <marcus.lambert[ at ]gmail.com> 2/28/2007 6:57:58 PM
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

Re: Blackberry changing items in the background ... making save fail
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 2/28/2007 7:41:48 PM
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


<marcus.lambert[ at ]gmail.com> wrote in message
news:1172689077.970259.271240[ at ]v33g2000cwv.googlegroups.com...
[Quoted Text]
> 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
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net