Microsoft KB Archive/179104

From BetaArchive Wiki

Article ID: 179104

Article Last Modified on 5/9/2005



APPLIES TO

  • Microsoft Collaboration Data Objects 1.1
  • Microsoft Collaboration Data Objects 1.2
  • Microsoft Collaboration Data Objects 1.21



This article was previously published under Q179104

SYMPTOMS

You may receive the error "Access Denied" trying to invoke certain properties of Collaboration Data Objects (1.1, 1.2, 1.21) objects from VBScript (VBS) when the same operation succeeds from a Visual Basic application.

STATUS

This behavior is by design to ensure the security of message stores and address books.

MORE INFORMATION

Steps to Reproduce Behavior

   'Following is the VBScript code to reproduce the behavior:
   'This sample assumes that the CDO (1.1, 1.2, 1.21) library is installed
   'on the test system and that a profile named "Microsoft Outlook"
   'exists.

   Sub but_OnClick
     Dim objSession
     Set objSession = CreateObject("mapi.session")
     objSession.Logon "Microsoft Outlook"
     MsgBox objSession.Inbox.Messages.Count 'This fails w/Access Denied
     objSession.Logoff
   End Sub
                

NOTE: This issue does not occur with all properties and methods; some operations (like sending messages) and some properties operate as expected.

REFERENCES

For information on where to acquire the most recent version of the CDO (1.x) Libraries, please see the following article in the Microsoft Knowledge Base:

171440 INFO: Where to Acquire the Collaboration Data Objects Libraries


Keywords: kberrmsg kbmsg kbprb KB179104