ActiveX currency type (MAPI)

Bradley Schatz bradley at greystate.com
Mon Jun 16 20:27:40 EDT 2003


Thanks Andrew!

Worked a treat.

-bradley

"Andrew Henshaw" <andrew. henshaw at gtri.gatech.edu> wrote in message
news:ver3p1nd0ivp9a at corp.supernews.com...
> Bradley Schatz wrote:
>
> > I am accessing through MAPI.Session, custom properties of outlook forms
> > that reside in Exchange.
> >
> > I am using the methods described comprehensively on the CDOLive site
> > http://www.cdolive.com/cdo10.htm , specifically the Fields interface.
> >
> > My problem is that for a Field that is of type Currency (the equivalent
> > type of vbCurrency) I am getting a return of a tuple - for example for a
> > price of $ 21,000,000 I get the tuple [4, -474836480]
> >
> > According to the CDOlive documentation, the value should be an 8byte
> > integer scaled by 1000.
> >
> > Has anyone any suggestions on how to coerce win32com to unmarshal this
> > type correctly?
> >
> > Thanks,
> >
> > Bradley
>
> Not sure if this is the best way, but it should work.
>
> import struct
>
> hi, lo = (4, -474836480)
> value = struct.unpack('q', struct.pack('II', lo, hi))
> print value
>
> >>
> 21000000000
>






More information about the Python-list mailing list