CDO CreateMHTMLBody Error

N

null_port

Regarding Peter Bromberg's article on saving web pages as mht's using
CDO:
http://www.eggheadcafe.com/articles/20040527.asp

I've been having fits when calling his sample code:
msg.CreateMHTMLBody(url,CDO.CdoMHTMLFlags.cdoSuppressNone, "", "" );


It errors with:
"Interface not registered"

Which QuickWatches as:
e {"Interface not registered\r\n" } System.Exception
+ [System.Runtime.InteropServices.COMException] {System.Runtime.InteropServices.COMException} System.Runtime.InteropServices.COMException
System.Object {System.Runtime.InteropServices.COMException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147221163 int
_innerException { } System.Exception
_message "Interface not registered\r\n" string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source "CDO.Message.1" string
+ _stackTrace {System.Array} System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147221163 int
InnerException { } System.Exception
Message "Interface not registered\r\n" string
Source "CDO.Message.1" string
StackTrace " at CDO.MessageClass.CreateMHTMLBody(String URL,
CdoMHTMLFlags Flags, String UserName, String Password)\r\n at
Scratchpad.Scratchpad.SaveWebPageToMHTFile(String url, String filePath)
in c:\\sos\\scratchpad\\scratchpad.cs:line 356" string
+ TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase


It does this for every site EXCEPT www.microsoft.com. That works fine.
As it turns out, several people have had this problem, but as far as
I've googled, it's never been answered, though it's been asked a dozen
times:
http://groups.google.com/groups?q=CreateMHTMLBody interface

Since 2003, people have been getting this error (As well as (Interface
not supported"). Same issue, they can get to microsoft.com, but not
other sites. Some report being able to access local files too.

I've tried removing and re-referencing ado and cdoex, creating a new
project, and re-regsvr32-ing various dll's, with no result. Tried
removing cdoex, and using cdosys. I ran Dependancy walker on cdoex.dll,
and found nothing missing except the ubiquitous mpr.dll export issue.

I'm running Windows XP SP2, current hotfixes, with Office (and Outlook)
XP, as well as VS 2003.

Can this one be nipped once and for all?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top