• Building an array (Access97/2000)

    Author
    Topic
    #378841

    I’m trying to send to multiple email addresses in Lotus notes from Access
    I’m told I need to use an array from what I have read on the Lotus site .
    If I type in Array(“john.doe@anyaddress.com”, “jane.doe@anyaddress.com”) in the code
    the email sends to both addresses without any problem.
    If I create a string from a multiselect listbox and pass the value to the lotus routine using
    “Array ( ” & strList & “)”
    strList contains “john.doe@anyaddress.com”, “jane.doe@anyaddress.com”
    I get the following email error
    User array (array@anyaddress.com) not listed in public Name & Address Book
    I’m not to familiar with arrays and not sure if you can create them this way.
    Can someone help me in creating it/
    Thanks,
    Scott

    Viewing 2 reply threads
    Author
    Replies
    • #628484

      Do you need to change the line:
      “Array ( ” & strList & “)”
      to:
      Array (strList)

      Pat smile

    • #628542

      If you’re doing it in Access 2000, you can use the Split function to take strList and convert it to a single dimension array. Split wasn’t introduced until A2k, so you can’t do it that way in A97.

      • #628960

        Thanks Charlotte,
        The split function did the trick. I have some users of Access97 and I was able to find this split
        function on the Lotus web site. It works in Access97
        Here it is for anyone interested.

        Function Split(splitstr As String, delim As String, includeempties As Variant) As Variant
        Dim words() As String
        Dim holder As String
        Dim x As Integer
        Dim counter As Integer
        Dim laststop As Integer
        On Error GoTo errorhandler
        ReDim words(0) As String
        laststop = 1
        For x = 0 To (Len(splitstr) – 1)
        holder = Mid$(splitstr, x + 1, 1)
        If (x 0) Then
        If (Mid$(splitstr, x, 1) = delim) Then
        If (includeempties = False) Then
        laststop = x + 1
        GoTo getnext
        End If
        End If
        ElseIf ((x = 0) And (holder = delim)) Then
        If (includeempties = False) Then
        laststop = x + 1
        GoTo getnext
        End If
        End If
        If (x = Len(splitstr) – 1) Then
        If (holder = delim) Then
        words(UBound(words)) = Mid$(splitstr, laststop, (x + 1) – laststop)
        laststop = x + 2
        ReDim Preserve words(UBound(words) + 1) As String
        Else
        words(UBound(words)) = Mid$(splitstr, laststop, (x + 2) – laststop)
        laststop = x + 2
        ReDim Preserve words(UBound(words) + 1) As String
        End If
        Else
        If (holder = delim) Then
        If (x Len(splitstr) – 1) Then
        words(UBound(words)) = Mid$(splitstr, laststop, (x + 1) – laststop)
        laststop = x + 2
        Else
        words(UBound(words)) = Mid$(splitstr, laststop, x – (laststop – 1))
        End If
        ReDim Preserve words(UBound(words) + 1) As String
        End If
        End If
        getnext:
        Next x
        If (UBound(words) > 0) Then
        ReDim Preserve words(UBound(words) – 1) As String
        Else
        words(0) = “”
        End If
        Split = words
        Exit Function
        errorhandler:
        words(0) = “”
        Split = words
        Exit Function
        End Function

    • #631407

      Hi Scott
      I would be interested how the communication works between Access and Notes. I can create an E-mail from access, but it has to be sent by hand and I want to attach a file, whose name comes from a table.

    Viewing 2 reply threads
    Reply To: Building an array (Access97/2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: