October 2003 Archives

CDOSYS.dll missing

| 1 Comment

As I worked to convert the c# info in my post about saving a web page as an mht file, I ran into a problem with the reference to cdosys.dll.

A little research brought me to this page:

318823 - CDO for Windows 2000 Library Reference Is Unavailable in Visual Basic Project

There I learned:

If you try to create or modify a project that references the Microsoft Collaboration Data Objects for Windows 2000 (CDOSYS) Library, the reference is not available. The reference for the Microsoft Collaboration Data Objects (CDO) for Exchange 2000 Library is present instead.

So the quest continues.

Saveas MTH file


I want to download and programatically save web pages as mht files. I was having a hard time until I went to IE SaveAS MHTML in C#, where I found the following code:

Make a reference to these two COM objects:
C:\Program Files\Common Files\System\ado\msado15.dll

I don't think neither of these have PIAs (Primary Interop Assembly) so this will generate two typelibs for your project.

The Source:

CDO.MessageClass message = new CDO.MessageClass();
message.CreateMHTMLBody("http://www.fanms.com/", CDO.CdoMHTMLFlags.cdoSuppressNone, "", "");

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

Now I just have to change it to VB.

Update: Here is my version of this code in VB:

Dim message As New CDO.MessageClass()
message.CreateMHTMLBody("http://www.iodid.com", CDO.CdoMHTMLFlags.cdoSuppressNone, "", "")

Dim Outstream As ADODB.Stream
Outstream = message.GetStream
Outstream.SaveToFile("c:\test.mht", ADODB.SaveOptionsEnum.adSaveCreateOverWrite)

About this Archive

This page is an archive of entries from October 2003 listed from newest to oldest.

August 2003 is the previous archive.

January 2004 is the next archive.

Find recent content on the main index or look in the archives to find all content.