I want to make connection with the exchange server to search mails in the
bublic folders and copy the information to a file. I made a script the
perfectly can connect but the problem is that outlook needs to be opened ,
when I run the script when outlook is closed , I get the following error:
Collaboration Data Objects: [Collaboration Data
Objects -[MAPI_E_FAILONEPROVIDER(8004011D)]]
This is a part of my script where I use the connection :
strProfileInfo = strServer & vblf & strMailbox
Set objSession = CreateObject("MAPI.Session")
objSession.Logon , , , False, , True, strProfileInfo
Set objInfoStores = objSession.InfoStores
For i = 1 To objInfoStores.Count
If objInfoStores.Item(i)= "Public Folders" Then
Set objInfoStore=objInfoStores.Item(i)
Exit For
End If
Next
bstrPublicRootID = objInfoStore.Fields.Item( &H66310102 ).Value
Set objTopFolder = objSession.GetFolder(bstrPublicRootID,objInfoStore.ID)
Set objFolders = objTopFolder.Folders
Set objFolder = objFolders.GetFirst()
Do Until objFolder.Name = "ICT - Change Management"
Set objFolder=objFolders.GetNext()
Loop
Bert Geys