Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21342

[RESOLVED] how to determine if there is an invalid character before sending a email in listview

$
0
0
i have a listview with emails inside
now is there a way to determine if the email is invalid and the user wont be able to send this email because its invalid?
this is my code
Code:

Private Sub BttnSend_Click()
  Dim SendToAll As String
   
    LsVw.SetFocus

    For i = 1 To LsVw.ListItems.Count
        If LsVw.ListItems(i).Checked And Len(Trim$(LsVw.ListItems(i).SubItems(1))) <> 0 Then
            SendToAll = SendToAll & LsVw.ListItems(i).SubItems(1) & "; "
        End If
    Next

    If SendToAll = vbNullString Then
        MsgBox "you have to choose at least 1 customer from the list", vbExclamation
        TxtFind.text = ""
        Check1.Value = 0
        LsVw.SetFocus
    Else
        ShellExecute hWnd, "open", "mailto:" & SendToAll, vbNullString, vbNullString, SW_SHOW
    End If
    Check1.Value = 0
End Sub

tnx in advanced
salsa31

Viewing all articles
Browse latest Browse all 21342

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>