Using CDO and CreateMHTMLBody

  • Thread starter Thread starter Olivier
  • Start date Start date
O

Olivier

Hi,
I use CDO and CreateMHTMLBody to retrieve source of my page. It work
great but...
on some site the result file is different from the SaveAS of Internet
Explorer: all .js code is not present with CreateMHTMLBody (whereas
img are correct).
I don't know how to force the same behaviour. The problem can be
reproduced on http://www.ratp.fr
Here is my code:
public static string WBSaveAsMHT(string url)
{
CDO.Message msg = null;
ADODB.Stream stream = null;
string source = string.Empty;

try
{
msg = new CDO.MessageClass();
msg.CreateMHTMLBody(url,
CDO.CdoMHTMLFlags.cdoSuppressNone, null, null);
stream = msg.GetStream();
source = stream.ReadText(stream.Size);
return source;
}
catch (Exception ex)
{
}

return source;
}
Thanks !
 
Back
Top