Simulate an Outlook Address Book Records Selection

Simulate an Outlook Address Book Records Selection

This tip shows how to simulate the look of an Oultlook address book records selection.

  • Open a New VB Project and add a New Form with 1 Text Box and a List Box.
  • Copy this code and you are set to go:
  •  	Private Sub Text1_Change()	    	    Dim intI As Integer	    Dim strTmp As String	    	    strTmp = Text1.Text	    intI = MatchList(strTmp, List1) 'Call the Function	    	    If intI >= 0 Then	        List1.ListIndex = intI	        List1.TopIndex = intI	    End If	End Sub	Function MatchList(strIn As String, listIn As ListBox) As Integer	'------------------------------------------------------------	'Function to match the typed string from an existing list box	'NOTE : The list should be sorted	'------------------------------------------------------------	    Dim blnMatchFound As Boolean	    Dim intI As Integer	    Dim intstrLength As Integer	    Dim strFirstLetter As String	    	    intstrLength = Trim(Len(strIn))	    strFirstLetter = UCase(Left(Trim(strIn), 1))	    	    '*** Search for exact match ***	    For intI = 0 To listIn.ListCount - 1	     If Left(UCase(listIn.List(intI)), intstrLength) LikeUCase(strIn) Then	         blnMatchFound = True	         MatchList = intI	         Exit Function	     End If	    Next	    	    '*** Search for After/Before strings (if no match has beenfound) ***	    If blnMatchFound = False Then	        For intI = 0 To listIn.ListCount - 1	          If Left(UCase(listIn.List(intI)), 1) >UCase(strFirstLetter) Then	              blnMatchFound = True	              MatchList = intI	              Exit Function	          Else	              blnMatchFound = True	              MatchList = intI	          End If	        Next	    End If	    	End Function	Private Sub Form_Load()	    List1.AddItem

    Share the Post:
    Heading photo, Metadata.

    What is Metadata?

    What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

    XDR solutions

    The Benefits of Using XDR Solutions

    Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

    AI is revolutionizing fraud detection

    How AI is Revolutionizing Fraud Detection

    Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

    AI innovation

    Companies Leading AI Innovation in 2023

    Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several