using cdo.dll in vb6 error

Fraser_Admin
Fraser_Admin used Ask the Experts™
on
I'm trying to build a cdo 1.2 messaging application in vb6.  When I have the following code:
Set oSession = CreateObject("mapi.session")

I get the following error when i try to run...
ActiveX component can't create object.

I have included the cdo.dll in my project references.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015

Commented:
{Just as a wild guess}

Do you have this line before your Set statement

Dim oSession as MAPI.Session

Author

Commented:
hehehe yep.  i think the problem may be due to the fact that when outlook was installed the cdo stuff wasn't.

i tried just copying the cdo.dll to the proper directory, but maybe there is more to the installation that needs to be done?
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015

Commented:
>i tried just copying the cdo.dll to the proper directory,
{Another wild guess, I'm on a roll...}
If you just copied the file, you still need to register it.  Go to Start button, run, type the below line, hit Ok button (requires some renaming):

regsvr32.exe c:\winnt\system32\wherever_the_heck_you_put_this\cdo.dll
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
i get this when i try to register it.  even though it is definitly there.

---------------------------
RegSvr32
---------------------------
LoadLibrary("CDO.dll") failed - The specified module could not be found.


---------------------------
OK  
---------------------------
SQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015
Commented:
Make sure you have the exact path, and for kicks and giggles type it here...

Author

Commented:
i installed the outlook cdo component and all works good now.  thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial