Re: [pywin32-bugs] String limitations on outlook email messages?
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@sk...> - 2012-01-10 01:38:59
|
Note that this mailing list is for messages from the source-force bug tracker - please follow up on the pyt...@py... mailing list. You might have luck if you open the property as a stream - the following code is from the spambayes source: def GetPropFromStream(mapi_object, prop_id): try: stream = mapi_object.OpenProperty(prop_id, pythoncom.IID_IStream, 0, 0) chunks = [] while 1: chunk = stream.Read(4096) if not chunk: break chunks.append(chunk) return "".join(chunks) except pythoncom.com_error, d: print "Error getting property", mapiutil.GetPropTagName(prop_id), \ "from stream:", d return "" HTH, Mark On 10/01/2012 12:18 PM, Miller, Mike F wrote: > I seem to be hitting a problem where the body of outlook email messages > are truncated at 255-ish characters when extracting the data. I’ve got > scripts that send email to a known account with a single character > separated values line of data. Then a python script collects the data > from each email in the folder: > > for indexItem in indexRange: > > # collect an email, add to buffer, delete > > emailItem = emailItems.Item(indexItem) > > buffer.append(emailItem.Body) > > print emailItem.Body > > But I’m seeing truncation on the emailItem.Body data that is about the > 255-char point. > > Is this a known issue of some kind? I’ve set emailItem.Body to much > larger strings on a number of occasions, so I know that works. > > I can dig further on this, but I thought that checking with the experts > first would be a good idea J > > - Mike Miller > > > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > > > > _______________________________________________ > pywin32-bugs mailing list > pyw...@li... > https://lists.sourceforge.net/lists/listinfo/pywin32-bugs |