This is a discussion on Writing out contents of Text Attachment using Event Sink - Microsoft Exchange ; I'm trying to write out to a string the contents of a text attachment but I'm struggling. I can access the attachment and have checked that the filename is correct but everytime I try to write out the contents to ...
I'm trying to write out to a string the contents of a text attachment but
I'm struggling. I can access the attachment and have checked that the
filename is correct but everytime I try to write out the contents to a
string I get the value "ADODB.StreamClass" rather than the contents of the
attachment.
Here is a fragment of the code that I have been using:
iAttach = iMessage.Attachments[1];
WriteToLog(iAttach.FileName); //Filename is correct
iAttach.ContentMediaType = "text/plain";
ADODB.Stream stm = iAttach.GetDecodedContentStream();
//stm.Type = ADODB.StreamTypeEnum.adTypeText;
//stm.Charset = "ASCII";
//WriteToLog(stm.ReadText(adReadAll));
WriteToLog(stm.ToString());
Thanks
Andrew