Hi Guys,

I have VB.NET code that is supposed to perform busy search for a user. It will connect to a POA, create an appointment object with all parameters set. then the user has the option to check if the recipient is busy at that particular time, before sending an appointment.

Everything works including setting date,recipient and sending works fine, but the part when I want to check the results of busy search doesn't work and gives an exception of: "invalid argument passed to the function call".



            Do While Not (myDraftMsg.BusySearchResult.Completed)


            While i < myDraftMsg.BusySearchResult.CombinedResult.FreeBlocks.Count 

                If myDraftMsg.BusySearchResult.CombinedResult.FreeBlocks.Item(i).StartDate  = mainModule.Apptdate 
                    'myDraftMsg.BusySearchResult.CombinedResult.TimeBlocks Then
                    MsgBox("user will be busy, select other time", MsgBoxStyle.Information)
                    Exit While
                End If

                i += 1

            End While

        Catch ex As Exception

        End Try
The exception happens exactly at the line of the if statement. I don't see any function call here, so I don't know what it is complaining about. There might be something wrong with how i check the busysearch result, and the developer guide does not have any good examples...

Any tips?