Re: setting MAPI fields in OLK 2003 with .NET 2003
- From: MauricioPV <MauricioPV@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Dec 2006 04:42:00 -0800
Hi Dmitry,
I tried this:
----------------------------------------------------------------------------------
Public Sub SetCampoMAPIconRedemption(ByVal xItem As MailItem, ByVal
xsCampo As String, ByVal xsValor As String)
Dim sItem As New Redemption.SafeMailItem, PR_MY_PROP As Object
'sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = xItem
PR_MY_PROP =
sItem.GetIDsFromNames("{00020329-0000-0000-C000-000000000046}", xsCampo) 'or
&H101E 'PT_UNICODE
Dim PropValue(0) As String
PropValue(0) = xsValor
sItem.Fields(PR_MY_PROP) = PropValue 'xsValor
'to convince Outlook something has changed
sItem.Item.Subject = sItem.Item.Subject
sItem.Save()
End Sub
---------------------------------------------------------------------------------
this did not work.. PR_MY_PROP get the value "-2089811968" I suppose that is
an error number.
Maybe I not understood your explanation??
thanks,
Mauricio.
"Dmitry Streblechenko" wrote:
Something like the following would do.
set sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = Item
PR_MY_PROP = sItem.GetIDsFromNames("{00020329-0000-0000-C000-000000000046}",
"Test MV Prop") or &H101E 'PT_UNICODE
Dim PropValue(3)
PropValue(0) = "test 1"
PropValue(1) = "test 2"
PropValue(2) = "test 3"
sItem.Fields(PR_MY_PROP) = PropValue
'to convince Outlook something has changed
sItem.Subject = sItem.Subject
sItem.Save
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"MauricioPV" <MauricioPV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F07C3AF2-BB77-47EA-B34F-7941156F6F6F@xxxxxxxxxxxxxxxx
Hi,
yes I'm using CDO to set mapi fields.
example:
---------------------------------------------------------------------------
Dim lmsg As MAPI.Message
lmsg = MSession.GetMessage(Item.EntryID, Item.Parent.StoreId)
lmsg.Fields.Add(Campo, vbArray + vbString, larValor)
----------------------------------------------------------------------------
Could you post some example of setting custom mapi fields with Redemption
or
with MailItem.MAPIOBJECT ??
(I saw your examples with existing properties, but I need some example
with
properties created by the user)
thanks a lot,
Mauricio.
"Dmitry Streblechenko" wrote:
How exactly do you set those MAPI propeties? Are you reopening the
message
with CDO 1.21? If yes, this error is to be expected since the message is
modified behind the scenes by CDO and when Outlook tries to save it, the
store provider returns an error saying that there was a conflict.
You need to set the properties using the MailItem.MAPIOBJECT property
(which
returns IMessage Extended MAPI interface), that's the message used by
Outlook itself, there won't be any conflicts if you use it . You cannot
use
it from CDO, it is either pure Extended MAPI or the Safe*Item family of
objects in Redemption (URL below)
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"MauricioPV" <MauricioPV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BE3BF209-E0D5-4408-8EBA-118434BFEB9D@xxxxxxxxxxxxxxxx
Hi, I have a .net 2003 outlook addin, in this addin I set and modify
mapi
fields on email items.
If I set a field in a new message which is saved into drafts, when the
user
open it from drafts and make some changes and Save the message a
warning
message appear: "The item could not be saved because it has been
changed
by
another user o in another window.Do you want to make a copy in the
default
folder for the item?"
I get this class of behaviors only when I work with mapi fields, if you
see
this link:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1000037&SiteID=1
you'll see that I was testing a lot of things but nothing seems work to
me...
Anyone could give me some suggest?
Thanks,
Mauricio.
- Follow-Ups:
- Re: setting MAPI fields in OLK 2003 with .NET 2003
- From: Ken Slovak - [MVP - Outlook]
- Re: setting MAPI fields in OLK 2003 with .NET 2003
- References:
- Re: setting MAPI fields in OLK 2003 with .NET 2003
- From: Dmitry Streblechenko
- Re: setting MAPI fields in OLK 2003 with .NET 2003
- From: MauricioPV
- Re: setting MAPI fields in OLK 2003 with .NET 2003
- From: Dmitry Streblechenko
- Re: setting MAPI fields in OLK 2003 with .NET 2003
- Prev by Date: Function works in WidowsXP but not Windows 2000
- Next by Date: Re: how to handle bulk deletion for contacts through code
- Previous by thread: Re: setting MAPI fields in OLK 2003 with .NET 2003
- Next by thread: Re: setting MAPI fields in OLK 2003 with .NET 2003
- Index(es):
Relevant Pages
|
Loading