Christian K. wrote: > def TextToStream(mapi_object, text): > prop_id = PR_BODY_A > stream = mapi_object.OpenProperty(prop_id, > pythoncom.IID_IStream, > 0, mapi.MAPI_MODIFY) > print stream.Stat(0) > print stream.Write('papperlapapp\n'*10) > mapi.RTFSync(mapi_object, > mapi.RTF_SYNC_BODY_CHANGED|mapi.RTF_SYNC_RTF_CHANGED) > stream.Commit(1) > del stream # instead of calling Release, which I could not find
Found the solution. Partly a stupid mistake. I forgot to call SaveChanges, for my excuse: it is not mentioned in the article above. And the setting the PR_RTF_IN_SYNC to false is crucial to make outlook convert the plain text to RTF. mapi_object.SetProps([(PR_RTF_IN_SYNC, 0)]) mapi_object.SaveChanges() Thanks Mark for your help, Christian _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32