count = IDEntries(hIDTable)
If (count = 0) Then
Goto freeIDTable
Else
'** redim the return array to the proper size, but don't let it get
'** too big
If (count > 32767) Then
Redim returnArray(32767) As String
Else
Redim returnArray(count) As String
End If
count = 0
End If
'** get the NoteIDs in the table and put them in the array
firstFlag = True
Do While IDScan(hIDTable, firstFlag, noteID) > 0
returnArray(count) = ConvertNoteID(noteID)
firstFlag = False
count = count + 1
If (count > Ubound(returnArray)) Then
Exit Do
End If
Loop