save to MHT failed

1 posts, 0 answers
  1. Ricky
    Ricky avatar
    10 posts
    Member since:
    Apr 2012

    Posted 30 May 2012 Link to this post

    I tried to save a page to MHT file programmatically using the following code:


     CDO.Message msg = new CDO.MessageClass();
            ADODB.Stream srm = null;
            msg.MimeFormatted = true;
            msg.CreateMHTMLBody("Test.aspx", CDO.CdoMHTMLFlags.cdoSuppressNone, "", "");
            srm = msg.GetStream();
            srm.SaveToFile(@"F:\Sample.mht", ADODB.SaveOptionsEnum.adSaveCreateNotExist);
            msg = null;
            srm.Close();


    It is failed on msg.CreateMHTMLBody("Test.aspx", CDO.CdoMHTMLFlags.cdoSuppressNone, "", "");  with message :

    Error: Sys.WebForms.PageRequestManagerServerErrorException: The specified protocol is unknown.



Back to Top