GetDecodedContentStream Method
GetDecodedContentStream Method
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Returns the Microsoft ActiveX Data Objects (ADO) Stream object containing the body part content in decoded format.
Applies To
Type Library
Microsoft CDO for Exchange 2000 Library
DLL Implemented In
CDOEX.DLL
Syntax
[Visual Basic]Function GetDecodedContentStream
() As ADODB.Stream
[C++]HRESULT GetDecodedContentStream ( _Stream** pVal );
Parameters
- pVal
Returned reference to a _Stream object.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
CDO uses the current value of the ContentTransferEncoding property and the MIMEFormatted property to determine which encoding mechanism to use to decode or encode the contents of the implementing object. It is the programmer's responsibility to have the appropriate value set in ContentTransferEncoding.
The Stream object returned contains a read/write copy of the current (decoded) contents of the object implementing IBodyPart. If you modify the contents within the returned Stream object, you must call the Flush method to commit the changes back into the object.
The GetDecodedContentStream method returns an error if called on an object that has Content-Type set to "multipart".
To obtain the encoded content, use the GetEncodedContentStream Method.
Example
[Visual Basic]
Dim iMsg As New CDO.Message Dim iBp As CDO.IBodyPart Set iBp = iMsg.BodyPart.AddBodyPart Dim Strm As ADODB.Stream Set Strm = iBp.GetDecodedContentStream Strm.WriteText "This is some text for the body part" Strm.Flush
' Add more body parts, etc. '... iMsg.Send
Strm.Close Set Strm = Nothing
See Also
CDO BodyPart Fields and Streams
Send us your feedback about the Microsoft Exchange Server 2003 SDK.
Build: June 2007 (2007.618.1)
© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.