The IMailBox.BaseFolder, IMailBox.RootFolder, and IMailBox.Inbox CDOEX properties may return blank values when you use script code to access a hierarchy of folders that belongs to a person (899351)



The information in this article applies to:

  • Collaboration Data Objects for Exchange 2000

SYMPTOMS

When you use script code to access a hierarchy of folders that belongs to a person, the following Collaboration Data Objects for Exchange (CDO) for Exchange 2000 Server (CDOEX) properties may return blank values:
  • IMailBox.BaseFolder
  • IMailBox.RootFolder
  • IMailBox.Inbox

CAUSE

This problem occurs because the Ole32.dll file is not correctly registered on the computer where you run the script code.

RESOLUTION

To resolve this problem, reregister the Ole32.dll file on the computer where you want to run the script code. To do this, follow these steps:
  1. Click Start, click Run, type the following command, and then click OK.

    Regsvr32.exe %Windir%\System32\Ole32.dll

  2. In the RegSvr32 dialog box, click OK.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

Use the following code example:
email = WScript.Arguments(0)
dn = WScript.Arguments(1)
 
WScript.Echo "email=" & email
WScript.Echo "dn=" & dn
WScript.Echo 
 
Set Person = CreateObject("CDO.Person")
if Person is Nothing then
            WScript.Echo "person object is nothing"
end if
 
strURL = "mailto:" & email
WScript.Echo "strURL:" & strURL
WScript.Echo 
Person.DataSource.Open strURL
WScript.Echo "FirstName: " & Person.FirstName
Set Mailbox = Person.GetInterface("IMailbox")
 
'These lines appear if the e-mail is valid.
'However, the Mailbox.X paths are blank.
WScript.Echo "inbox:" & email & " is: " & Mailbox.Inbox
WScript.Echo "base :" & email & " is: " & Mailbox.BaseFolder
WScript.Echo "root :" & email & " is: " & Mailbox.Rootfolder
 
 
Set Person = nothing
Set Person = CreateObject("CDO.Person")
strURL = "LDAP://" & dn
WScript.Echo 
WScript.Echo "strURL:" & strURL
WScript.Echo 
Person.DataSource.Open strURL
WScript.Echo "FirstName: " & Person.FirstName
Set Mailbox = Person.GetInterface("IMailbox")
 
'These lines appear if the dn is valid.
'However, the Mailbox.X paths are blank.
WScript.Echo "inbox:" & email & " is: " & Mailbox.Inbox
WScript.Echo "base :" & email & " is: " & Mailbox.BaseFolder
WScript.Echo "root :" & email & " is: " & Mailbox.Rootfolder
You experience the behavior that is mentioned in the "Symptoms" section.

Modification Type:MajorLast Reviewed:9/27/2005
Keywords:kbprb kbtshoot KB899351 kbAudDeveloper