问题
I'm trying to use the redemption library in my script now and I can't load it.
Set m_objRDOSession = CreateObject("Redemption.RDOSession")
I have also tried to load it directly like the following
Set m_objRDOSession = GetObject("Redemption.dll", "Redemption.RDOSession")
Both the same error code, with null message and source.
I'm using windows 64 bit with outlook 32 bit. I have successfully loaded the library with c# and the redemption loader on the same machine.
PS: I should mention that I saw the terms and agreement prompt before the error got thrown.
What can I do?
回答1:
Error code 0x800401FA
is CO_E_WRONGOSFORAPP
.
If the machine is 64 bit, you will end up using the 64 bit version of cscript.exe, but the bitness of your code must match the bitness of Outlook - use cscript.exe from the SysWow64 folder.
Extended MAPI is a set of dlls loaded in-proc, and a 64 bit process cannot load a 32 bit dll and vice versa.
See http://www.dimastr.com/redemption/faq.htm#ErrorCreatingRedemptionObject for more details.
回答2:
Did you register the DLL to the machine?
Using CreateObject must have the COM object in the local registry.
In C# you can load the library without registering it using the RedemptionLoader class, but this method can not be used in VBScript.
来源:https://stackoverflow.com/questions/18598284/createobjectredemption-rdosession-returns-error-code-800401fa