Results 1 to 16 of 16

Thread: Removing a box??

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Removing a box??

    This is my code and everything works well however there are little boxes after most lines and guess this is where someone hit the space bar after entering it on the online form??

    How can I remove it??


    VB Code:
    1. ssource = Inet1.OpenURL("http://www.mysite.com/application/get_news.php?id=" & Form1.Text2.Text)
    2. lStart = 1
    3. lEnd = 1
    4. sFindStart = "##"
    5. sFindEnd = "/##"
    6. lStart = InStr(lStart, ssource, sFindStart, vbTextCompare)
    7. If lStart Then
    8. lStart = lStart + Len(sFindStart)
    9. lEnd = InStr(lStart, ssource, sFindEnd, vbTextCompare)
    10. If lEnd > lStart Then
    11. Body = Mid$(ssource, lStart, lEnd - lStart)
    12. NewBody = Replace(Body, "<p>", vbCrLf)
    13. NewBody2 = Replace(NewBody, "</p>", vbCrLf)
    14. NewBody3 = Replace(NewBody2, "</br>", vbCrLf)
    15. NewBody4 = Replace(NewBody3, "<br>", vbCrLf)
    16. Text5.Text = NewBody4
    17. 'Text5.Text = Mid$(ssource, lStart, lEnd - lStart)
    18. Else
    19. Debug.Print "End text not found."
    20. End If
    21. Else
    22. Debug.Print "Text not found."
    23. End If

  2. #2

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Re: Removing a box??

    No it does not fix it :-(

    Any other ideas?

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Removing a box??

    Try vbLf instead of vbCrLf:

    VB Code:
    1. NewBody = Replace(Body, "<p>", vbLf)
    2. NewBody2 = Replace(NewBody, "</p>", vbLf)
    3. NewBody3 = Replace(NewBody2, "</br>", vbLf)
    4. NewBody4 = Replace(NewBody3, "<br>", vbLf)

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Re: Removing a box??

    God no that makes it worse, thanks for the idea however :-)

  6. #6
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Removing a box??

    Maybe this can help:

    VB Code:
    1. Dim newString As String * 1
    2.    newString = 'put in here the box char
    3.       Text5.Text = Replace(NewBody4, newString, "")

  7. #7

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Re: Removing a box??

    Hi RhinoBull,

    yes I am, everything else works ie <p> and <br> it's just these [] or similiar that are showing.... it's not that though

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Re: Removing a box??

    You can see the problem here


  10. #10

  11. #11
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Removing a box??

    this should get rid of all boxes, no matter what they are

    VB Code:
    1. For i = 0 To 31
    2. Select Case i
    3.     Case 1 To 8, 11, 12, 14 To 31
    4.    
    5.     body = Replace(body, Chr(i), "")
    6. End Select
    7. Next
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  12. #12

  13. #13
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Removing a box??

    tab is 9
    cr is 13
    lf is 10

    all not included, they don't show as boxes
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  14. #14

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Re: Removing a box??

    Quote Originally Posted by westconn1
    this should get rid of all boxes, no matter what they are

    VB Code:
    1. For i = 0 To 31
    2. Select Case i
    3.     Case 1 To 8, 11, 12, 14 To 31
    4.    
    5.     body = Replace(body, Chr(i), "")
    6. End Select
    7. Next
    Will this change any number i have like "team one won 15 - 1"??

  15. #15
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Removing a box??

    Only numbers 1,2,3,4,5,6,7,8,11,12 and from 14 to 31.
    1 and 15 would be replaced.

  16. #16
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Removing a box??

    the code above will not replace any numbers at all

    it replaces characters with the ascii codes i listed, all of which display as small boxes
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width