Function URLPathEncode(ByVal Text As String) As String Dim i As Integer Dim acode As Integer URLPathEncode = Text For i = Len(URLPathEncode) To 1 Step -1 acode = Asc(Mid$(URLPathEncode, i, 1)) Select Case acode Case 48 To 57, 65 To 90, 97 To 122 Case 33, 35, 36, 38, 42, 43, 45, 46, 47, 58, 63, 64, 95, 126 Case Else URLPathEncode = Left$(URLPathEncode, i - 1) & "%" & Hex$(acode) _ & Mid$(URLPathEncode, i + 1) End Select Next End Function |