This is a migrated thread and some comments may be shown as answers.

save to MHT failed

0 Answers 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 1
Ricky asked on 31 May 2012, 04:11 AM
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.



No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Ricky
Top achievements
Rank 1
Share this question
or