Hello,
I have a function using InStr that is not matching text correctly. I am trying to remove characters that can't be used in a URL:
Public Function NewSEName(ID As Long, TitleIn As String) As String
Dim strNewTitle As String
Dim i As Integer
Dim strOutput As String
strNewTitle = TitleIn
For i = 1 To Len(strNewTitle)
If InStr(i, "abcdefghijklmnopqrstuvwxyz1234567890 _-", Mid(strNewTitle, i, 1), vbTextCompare) > 0 Then
strOutput = strOutput & Mid(strNewTitle, i, 1)
End If
Next i
NewSEName = Trim(strOutput)
End Function
Problem:
Input: p-3-test-record-co-f-müserss-flutes-sef-ed-francais.aspx
Output: p-3-tst-ror-----
When the loop gets to the letter "e" it starts to not match. I've tried <> 0, vbBinaryCompare, vbDatabaseCompare, but no luck.
Any help appreciated,
Albert
Albert S