Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you pass a Line Break/Carriage Return in URL 1

Status
Not open for further replies.

mrgulic

Technical User
Sep 18, 2001
248
US
When I try to pass information from an outlook email message, the format is stripped.

It sends it as one long string without any line breaks. Does anyone have any ideas?

This how the code looks:
Code:
Dim objXMLHTTP As MSXML2.XMLHTTP 
Dim strCGIForm As String
Dim strType As String, strLevel1 As String, strLevel2 As String, strLevel3 As String, strDesc As String
Dim strWebResult As String, strVars As String

strCGIForm = "[URL unfurl="true"]http://cprweb/clearexp_cgi.exe/dd_topaz.htm"[/URL]
strType = "call_type"
strLevel1 = "level1" 
strLevel2 = "level2" 
strLevel3 = "level3" 
strDesc = "CASE_DESCRIPTION"

    strVars = "?"
    strVars = strVars & strType & "=" & strCaseType & "&"
    strVars = strVars & strLevel1 & "=" & strCaseL1 & "&"
    strVars = strVars & strLevel2 & "=" & strCaseL2 & "&"
    strVars = strVars & strLevel3 & "=" & strCaseL3 & "&"
    strVars = strVars & strDesc & "=" & strBody & "&"

Set objXMLHTTP = CreateObject("MSXML2.XMLhttp")
With objXMLHTTP
  .Open "GET", strCGIForm & strVars, False
  .Send '**Send Variables
End With
thanks
 
Try this
Code:
%0D%0A

where it's zero D zero A, the hexadecimal equivalent of carriage return and line feed.

Lee
 
I took it to the next level:

Code:
Function UrlEncode(ByVal urlText As String) As String
    Dim i As Long
    Dim ansi() As Byte
    Dim ascii As Integer
    Dim encText As String

    ansi = StrConv(urlText, vbFromUnicode)

    encText = ""
        For i = 0 To UBound(ansi)
        ascii = ansi(i)

        Select Case ascii
        Case 48 To 57, 65 To 90, 97 To 122
            encText = encText & Chr(ascii)

        Case 32
            encText = encText & "+"

        Case Else
            If ascii < 16 Then
                encText = encText & "%0" & Hex(ascii)
            Else
                encText = encText & "%" & Hex(ascii)
            End If

        End Select
    Next i
    
    UrlEncode = encText
End Function

Thanks to: Shen Cheng-Da
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top