CDO

N

news.microsoft.com

Hello!

I run the following code:


Dim oSession As MAPI.Session
Dim oFolder As MAPI.Folder

Set oSession = CreateObject("MAPI.Session")
oSession.Logon psProfileName, psProfilePassword, False, True, , ,
psProfileInfo
Set oFolder = oSession.GetDefaultFolder(CdoDefaultFolderCalendar)

It works fine on Outlook 2000 and Exchange 2000
but it doesn´t seem to work on Outlook 2003 with Exchange 2003.
The last line fails with the message "Object doesn't support this property
or method".
Anyone have an idea?

/Erik Juhlin
 
D

Dan Mitchell

news.microsoft.com said:
[snip]
oSession.Logon psProfileName, psProfilePassword, False, True, , ,
psProfileInfo
Set oFolder = oSession.GetDefaultFolder(CdoDefaultFolderCalendar)

It works fine on Outlook 2000 and Exchange 2000
but it doesn´t seem to work on Outlook 2003 with Exchange 2003.
The last line fails with the message "Object doesn't support this
property or method".

Why are you passing in profilename and profileinfo; from the docs: "The
profileName parameter is ignored if ProfileInfo is supplied.".

Also, there's issues with using profileinfo where it won't work with
GetDefaultFolder et al -- see http://support.microsoft.com/?kbid=183093
.. That article claims it's only relevant to Windows 95, but I've seen it
on Win2K/NT, and it also claims that it's fixed in later versions, but
it sounds as if they've reintroduced it somehow.

Fixes: only use profilename, not profileinfo. If you don't know there's
a profile already there, use code like that in KB Q170225 to create a
profile dynamically from C/C++ (you'll need to put this in a DLL and
call it from VB somehow), profiles created that way don't have the same
problems as ones created from CDO.

-- dan
 

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