hoshbad
2009-03-30 11:33:40 UTC
Hi there,
I have a custom form with some business logic written in VB. The
script shall determine if a chosen resource is free oder busy for a
specified time range. So I used "getFreeBusy" on all AddressEntry-
objects (my resources). That worked pretty well with Exchange 2003.
Now I have updated the server to Exchange 2007 and the code within my
form does not work anymore. I always get the error "MAPI_E_NOT_FOUND".
I searched for serveral hours now and also found the knowledge base
article 179639 which said the following:
"You may be using the GetFreeBusy method against an Exchange Server
mailbox that has not been logged into yet, or that does not have any
appointments in the calendar."
But I am logged in (using the Logon method) and my calendar has
appointments.
I am despairing of this horrible situation. I hope you can help me.
Many thanks in advance.
My code is:
Function Item_Open()
dim oNameSpace
if len(item.entryId) = 0 then
set oNameSpace = Application.GetNameSpace("MAPI")
Set objCDO = CreateObject("MAPI.Session")
On Error Resume Next
objCDO.Logon
If Err Then
MsgBox "CDO-Sitzung kann nicht eingerichtet werden!",
vbCritical, "Fehler"
Else
set lstfahrzeuge = item.getinspector.modifiedformpages
("Nachricht").controls
Set objAddressLists = objcdo.AddressLists
Set CDOAddressList = objAddressLists.Item("Globales
Adressbuch").AddressEntries
if cdoAddresslist = nothing then
Set CDOAddressList = objAddressLists.Item("Globale
Adressliste").AddressEntries
end if
Set CDOAddressFilter = CDOAddressList.Filter
CDOAddressFilter.Name = "Wenzlaff, Sebastian"
' stop
For Each CDOAddress In CDOAddressList
strName = CDOAddress.Fields(&H3A00001E)
On Error Resume Next
strFreeBusy = cdoaddress.getfreebusy(item.userproperties
("Abfahrt"), item.userproperties("Rückkehr"), 30)
If Err Then
MsgBox Err.Description, vbCritical, "Fehler bei
GetFreeBusy"
Else
MsgBox "Alles ok", vbInfo, "Ok!"
End If
blnfree = true
for i = 1 to len(strfreebusy)
if mid(strfreebusy, i, 1) <> 0 then
blnfree = false
end if
next
if blnfree then
strname = "F: " & strname
else
strname = "B: " & strname
end if
strname = strname & " (" & stranmerkung & ")"
lstFahrzeuge("Fahrzeug").AddItem (strName)
Next
objCDO.logoff
end if
End Function
I have a custom form with some business logic written in VB. The
script shall determine if a chosen resource is free oder busy for a
specified time range. So I used "getFreeBusy" on all AddressEntry-
objects (my resources). That worked pretty well with Exchange 2003.
Now I have updated the server to Exchange 2007 and the code within my
form does not work anymore. I always get the error "MAPI_E_NOT_FOUND".
I searched for serveral hours now and also found the knowledge base
article 179639 which said the following:
"You may be using the GetFreeBusy method against an Exchange Server
mailbox that has not been logged into yet, or that does not have any
appointments in the calendar."
But I am logged in (using the Logon method) and my calendar has
appointments.
I am despairing of this horrible situation. I hope you can help me.
Many thanks in advance.
My code is:
Function Item_Open()
dim oNameSpace
if len(item.entryId) = 0 then
set oNameSpace = Application.GetNameSpace("MAPI")
Set objCDO = CreateObject("MAPI.Session")
On Error Resume Next
objCDO.Logon
If Err Then
MsgBox "CDO-Sitzung kann nicht eingerichtet werden!",
vbCritical, "Fehler"
Else
set lstfahrzeuge = item.getinspector.modifiedformpages
("Nachricht").controls
Set objAddressLists = objcdo.AddressLists
Set CDOAddressList = objAddressLists.Item("Globales
Adressbuch").AddressEntries
if cdoAddresslist = nothing then
Set CDOAddressList = objAddressLists.Item("Globale
Adressliste").AddressEntries
end if
Set CDOAddressFilter = CDOAddressList.Filter
CDOAddressFilter.Name = "Wenzlaff, Sebastian"
' stop
For Each CDOAddress In CDOAddressList
strName = CDOAddress.Fields(&H3A00001E)
On Error Resume Next
strFreeBusy = cdoaddress.getfreebusy(item.userproperties
("Abfahrt"), item.userproperties("Rückkehr"), 30)
If Err Then
MsgBox Err.Description, vbCritical, "Fehler bei
GetFreeBusy"
Else
MsgBox "Alles ok", vbInfo, "Ok!"
End If
blnfree = true
for i = 1 to len(strfreebusy)
if mid(strfreebusy, i, 1) <> 0 then
blnfree = false
end if
next
if blnfree then
strname = "F: " & strname
else
strname = "B: " & strname
end if
strname = strname & " (" & stranmerkung & ")"
lstFahrzeuge("Fahrzeug").AddItem (strName)
Next
objCDO.logoff
end if
End Function