Article ID: 899351 - Last Review: September 27, 2005 - Revision: 1.0
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
On This Page
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:
- Click Start, click Run,
type the following command, and then click
OK.Regsvr32.exe %Windir%\System32\Ole32.dll
- 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.RootfolderNote: This article is from Microsoft Knowledage Base
Related problems posted by other users | |
| more... |


