Changes by an RDO-Item only applies after Outlook restart

P

Peter Marchert

Hello,

with this code

With objItem

strSubject = Trim(.Subject)
strEntryID = .EntryID
strStoreID = .Parent.StoreID

End With

Set objRDOItem = m_objRDOSession.GetMessageFromID(strEntryID,
strStoreID)

With objRDOItem
.ConversationTopic = strSubject
.Save
End With

I change the conversationtopic of an file (not an email) in an email
folder (in the example it is a pdf file).

This works fine and the changes are displayed in the Outlook explorer
but they didn`t apply imeaditly to the file. So the code will change
the file each time he runs. After a restart of Outlook the changes are
ok.

I think something is wrong with my code or this informations are
cached anywhere?

PS: objItem and objRDOItem are declared as Object

Thanks for any help and suggestions!

Peter
 
D

Dmitry Streblechenko

I am not sure I understand what you mean by
"I change the conversationtopic of an file (not an email) in an email folder
(in the example it is a pdf file)."
Your code is changing the conversation topic of a regular message, not a
message created on top of an MSG file.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Hello,

with this code

With objItem

strSubject = Trim(.Subject)
strEntryID = .EntryID
strStoreID = .Parent.StoreID

End With

Set objRDOItem = m_objRDOSession.GetMessageFromID(strEntryID,
strStoreID)

With objRDOItem
.ConversationTopic = strSubject
.Save
End With

I change the conversationtopic of an file (not an email) in an email
folder (in the example it is a pdf file).

This works fine and the changes are displayed in the Outlook explorer
but they didn`t apply imeaditly to the file. So the code will change
the file each time he runs. After a restart of Outlook the changes are
ok.

I think something is wrong with my code or this informations are
cached anywhere?

PS: objItem and objRDOItem are declared as Object

Thanks for any help and suggestions!

Peter
 
P

Peter Marchert

Thanks Dmitry for your answer,

It`s a file I have dragged and dropped from the windows explorer to an
email folder (I don`t know what you mean with "on top of an MSG file",
sorry).

Peter
 
P

Peter Marchert

Hello again,

here I have a similar example with the same problem:

Public Sub Test()

Dim objNameSpace As Object
Dim objRDOSession As Object
Dim objRDOItem As Object
Dim strEntryID As String
Dim strStoreID As String

Set objRDOSession = CreateObject("Redemption.RDOSession")
Set objNameSpace = Nothing
Set objNameSpace = Outlook.GetNamespace("MAPI")
objNameSpace.Logon
objRDOSession.MAPIOBJECT = objNameSpace.MAPIOBJECT

With Outlook.ActiveExplorer.Selection(1)
strEntryID = .EntryID
strStoreID = .Parent.StoreID
End With

Set objRDOItem = objRDOSession.GetMessageFromID(strEntryID,
strStoreID)
objRDOItem.Subject = "Test"
objRDOItem.Save

End Sub

If I want to change the subject (or something else) after the code
made changes to the item, the following message appears: "The item
could not be saved because it has been changed by another user or in
another window"

I think this have to do with the RDO-Session and tried also
"objRDOSession.Logon "", "", False, False, 0" instead of
"objRDOSession.MAPIOBJECT = objNameSpace.MAPIOBJECT" but there is no
different. I´m using version 4.3.0.585.

Any suggestions are welcome!

Peter
 
D

Dmitry Streblechenko

This is an expected error - the message is opened by Outlook, then you
reopen it from Redemption and save it. When Outlook tries to save it, the
store reports that there was a conflict.
Why can't you use OOM to set the subject? Subject property does not cause
security prompts.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Hello again,

here I have a similar example with the same problem:

Public Sub Test()

Dim objNameSpace As Object
Dim objRDOSession As Object
Dim objRDOItem As Object
Dim strEntryID As String
Dim strStoreID As String

Set objRDOSession = CreateObject("Redemption.RDOSession")
Set objNameSpace = Nothing
Set objNameSpace = Outlook.GetNamespace("MAPI")
objNameSpace.Logon
objRDOSession.MAPIOBJECT = objNameSpace.MAPIOBJECT

With Outlook.ActiveExplorer.Selection(1)
strEntryID = .EntryID
strStoreID = .Parent.StoreID
End With

Set objRDOItem = objRDOSession.GetMessageFromID(strEntryID,
strStoreID)
objRDOItem.Subject = "Test"
objRDOItem.Save

End Sub

If I want to change the subject (or something else) after the code
made changes to the item, the following message appears: "The item
could not be saved because it has been changed by another user or in
another window"

I think this have to do with the RDO-Session and tried also
"objRDOSession.Logon "", "", False, False, 0" instead of
"objRDOSession.MAPIOBJECT = objNameSpace.MAPIOBJECT" but there is no
different. I´m using version 4.3.0.585.

Any suggestions are welcome!

Peter
 
P

Peter Marchert

Thanks for your answer, Dmitry.

The change of the subject was only a example. I posted a simple code
example to be sure that this behaivour is normal and have nothing to
do with the code.

I need the redemption to set the filename of the attachment of a
message (and/or documentitem, not a file :)).

Peter
 
D

Dmitry Streblechenko

Yes, if the message is also open in Outlook and modified, you will get a
conflict error.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Thanks for your answer, Dmitry.

The change of the subject was only a example. I posted a simple code
example to be sure that this behaivour is normal and have nothing to
do with the code.

I need the redemption to set the filename of the attachment of a
message (and/or documentitem, not a file :)).

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top