Dim Calls As List
Calls.Initialize
Dim CallLog As CallLog
Calls = CallLog.GetAll(10) 'Get the last 10 calls
For i = 0 To Calls.Size - 1
Dim c As CallItem
c = Calls.Get(i)
Dim callType, name As String
Select c.CallType
Case c.TYPE_INCOMING
callType="Incoming"
Case c.TYPE_MISSED
callType = "Missed"
Case c.TYPE_OUTGOING
callType = "Outgoing"
End Select
name = c.CachedName
If name = "" Then name = "N/A"
Log("Number=" & c.Number & ", Name=" & name _
& ", Type=" & callType & ", Date=" & DateTime.Date(c.Date))
Next