Results 1 to 2 of 2

Thread: Array question for Outlook

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    33

    Question

    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

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width