-
I`ve been struggling on this one for days...
Is there a way to check if an array index contains data?
I am trying to automate Outlook. If I delete the most highly indexed message I get an error message "Array index is out of bounds..."
I simply want to do a check on the particular index to see if it contains a value
eg:
if not ofolder.items(5) = NULL then
msgbox("Contains data")
else
msgbox("Contains nothing")
end if
-
<?>
Code:
'check to see if an array is empty
'avoid error on trying to view
Private Sub Form_Load()
Dim a() As Long 'your array
On Error GoTo QuitNow:
Debug.Print UBound(a)
On Error GoTo 0
Exit Sub
QuitNow:
Debug.Print "Error,no dimension for array!"
End Sub