CreateMHTMLBody Interface not supported.

  • Thread starter Thread starter Von Shean
  • Start date Start date
V

Von Shean

I use the following code to save pages as MHT

1 CDO.Message message = new CDO.MessageClass();
2 message.CreateMHTMLBody("http://www.google.com/", 0, "", "");

3 ADODB.Stream stream = message.GetStream();
4 stream.SaveToFile("fanms.mht",
ADODB.SaveOptionsEnum.adSaveCreateOverWrite);


On line i get a runtime error 'System.InvalidCastException: No such
interface supported'

Any Ideas?
 
Maybe it has something to do with the fact that you are creating a new
MessageClass instance and trying to set it into a Message variable.

Try something like: CDO.MessageClass message = new CDO.MessageClass();
 
Since this compiles nicely and errors at runtime.. i guess some problem is
there with registering the components..
This code used to work long ago. I used to have office 2002 on my win2k sp3
but now i have office 2003 on win2k sp4.

does this give any hints...
 
Back
Top