|
-
Nov 26th, 2000, 10:33 AM
#1
Thread Starter
New Member
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.
-
Nov 26th, 2000, 11:04 AM
#2
Lively Member
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
-
Nov 26th, 2000, 11:25 AM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|