How do i convert String to IStream And Vice Versa, in Delphi?

Viewed 145

i want to use :

Rslt := WrapCompressedRTFStream(OleStream, 0, Uncompressed);

where : OleStream, Uncompressed : IStream; and RTFStringIn RTFStringOut are String;

  1. i have the RTFStringIn (As String).
  2. convert it to OleStream (ISTREAM).
  3. run WrapCompressedRTFStream.
  4. convert the Uncompressed to RTFStringOut.

and then save it as RTF file. all that without using ExtendedMAPI.

1 Answers

For conversion use TStreamAdapter:

...
Stream := TStringStream.Create(your_string_here);
istr := TStreamAdapter.Create(Stream, soReference) as IStream;
...
Related