Results 1 to 22 of 22

Thread: Promt Warning List External Users, on VB Script to checks for external users

Threaded View

  1. #5
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,261

    Re: Promt Warning List External Users, on VB Script to checks for external users

    You have an InStr(s,"@")

    What is "s"?

    EDIT:
    btw: If you just want to grab the domain of an EMail-Address....

    Code:
    Dim sAddress As String
    Dim arrTemp() As String
    Dim sDomain As String
        
        sAddress = "[email protected]"
        
        If InStrRev(sAddress, "@") Then
        
            arrTemp = Split(sAddress, "@")
            sDomain = arrTemp(UBound(arrTemp))
        
        End If
    or shorter
    Code:
    Dim sAddress As String
    Dim sDomain As String
        
        sAddress = "[email protected]"
        
        If InStrRev(sAddress, "@") Then
        
            sDomain = Split(sAddress, "@")(1)
        
        End If
    Of course, that way you have to change your Select Case to check without the @-sign (or you prepend the @-sign to the result(s))
    Last edited by Zvoni; Sep 24th, 2018 at 03:47 AM.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

Tags for this Thread

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