function OpenStream(ForWriting: boolean = False): TStream;
Returns a stream containing the attachment content.
When the PathName property is set, the method opens the specified file and grants access to it. Otherwise, a pointer to the TMemoryStream object containing the attachment content is returned.
The ForWriting parameter indicates whether write access to the attachment content is required, or the stream is only used for reading data.
You should not free the object returned by this method.
Call the CloseStream method when you have finished reading/writing data.