Results 1 to 3 of 3

Thread: searching strings

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    2
    i am trying to search for a string in a string, my problem is the string i am searching for i only know the first few characters and the last few, the middle characters will change, is this possible.

  2. #2
    Lively Member
    Join Date
    Nov 2000
    Posts
    73
    i'am not sure whether u can do that way
    u can do this way u type the first few characters and get the rest typed in try the below code
    form

    MakeAutoComplete (Text1)

    'code
    Private Declare Function SHAutoComplete _
    Lib "Shlwapi.dll" _
    (ByVal hwndEdit As Long, _
    ByVal dwFlags As Long) As Long

    Private Const SHACF_DEFAULT As Long = &H0


  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    2
    ok this possible code i am going to use, and will eventually replace the string i am searching for with a different one that has been changed but depends on those middle characters from the findstring that i do not know and will change. what i need to know is if i can define the findstring in a way that this will work without knowing the middle 1-4 characters of the findstring.

    ' Get the first occurrence of the string
    StringPos = InStr(0, searchstring, findstring, vbTextCompare)
    If StringPos = 0 Then etc...

    Else
    ' Get the length of the string to find
    StringLen = Len(FindString)
    ' Set the starting position of the selection
    searchstring.SelStart = StringPos
    ' Set the selection length
    searchstring.SelLength = StringLength
    End If

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