Discussion:
[python-win32] How to set value for multi-valued property using mapi?
Kapil Dolas
2014-12-29 09:20:54 UTC
Permalink
Hi,

I want to set multiple values for multi-valued property using SetProps.
SetProps takes list of tuples of tag and value as argument, where value
should be string or unicode. How to set multiple values for multi-valued
property in this case? Should I convert list of values to string or
something like that?

Regards,
Kapil
Nick Czeczulin
2014-12-30 10:28:47 UTC
Permalink
I want to set multiple values for multi-valued property using SetProps. SetProps list
of tuples of tag and value as argument, where value should be string or unicode.
How to set multiple values for multi-valued property in this case? Should I convert list
of values to string or something like that?
The multi-valued property's type specifies what the values being passed should be. The below example's named property happens to be PT_MV_UNICODE, so we get and set the values using unicode.
msg.GetProps((0x80a2101f,))
(0, ((2158104607L, (u'Orange category', u'Green category', u'Blue category')),))
msg.SetProps( ((0x80a2101f,(u'Orange category', u'Green category', u'Blue category', u'Red category')),) )
(0, None)
msg.GetProps((0x80a2101f,))
(0, ((2158104607L, (u'Orange category', u'Green category', u'Blue category', u'Red category')),))

Hth,
-nick
Kapil Dolas
2015-01-01 18:31:11 UTC
Permalink
Hi Nick,

Thank you for replying. I tried example given by you and it worked. All MV
properties are working in the same way, except ones of type PT_MV_BINARY.
Can you give me example for setting PT_MV_BINARY values?

Thanks and Regards,
Kapil
Nick Czeczulin
2015-01-05 00:16:34 UTC
Permalink
Thank you for replying. I tried example given by you and it worked. All MV properties are working in the
same way, except ones of type PT_MV_BINARY. Can you give me example for setting PT_MV_BINARY values?
I think you will need to apply this patch for PT_MV_BINARY to work: http://sourceforge.net/p/pywin32/patches/137/
Mark Hammond
2015-01-05 05:20:43 UTC
Permalink
Post by Nick Czeczulin
Thank you for replying. I tried example given by you and it worked. All MV properties are working in the
same way, except ones of type PT_MV_BINARY. Can you give me example for setting PT_MV_BINARY values?
I think you will need to apply this patch for PT_MV_BINARY to work: http://sourceforge.net/p/pywin32/patches/137/
Oops - that's been pending for about a year - sorry about that. I just
pushed it.

Mark

Loading...