Function UrlEncode(strUrl) 'As String ' Take input string and return the URL encoded form. Dim intChar 'As Integer Dim strBuffer 'As String Dim strHex 'As String If strUrl = "" Then UrlEncode = "" Exit Function End If strBuffer = "" For intChar = 1 To Len(strUrl) Select Case Mid(strUrl, intChar, 1) Case "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z" strBuffer = strBuffer & Mid(strUrl, intChar, 1) Case "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z" strBuffer = strBuffer & Mid(strUrl, intChar, 1) Case "0","1","2","3","4","5","6","7","8","9" strBuffer = strBuffer & Mid(strUrl, intChar, 1) Case " " strBuffer = strBuffer & "+" Case Else strHex = Hex(Asc(Mid(strUrl, intChar, 1))) While Len(strHex) < 2 strHex = "0" & strHex Wend strBuffer = strBuffer & "%" & strHex End Select Next UrlEncode = strBuffer End Function