Results 1 to 5 of 5

Thread: how to grab every word that has the ! in it "good rating for answer"

  1. #1

    Thread Starter
    Fanatic Member newprogram's Avatar
    Join Date
    Apr 2006
    Location
    in your basement
    Posts
    769

    how to grab every word that has the ! in it "good rating for answer"

    how would I grab all that words with the ! in it and put them in text1 using the webbrowser control

    the webpage look like

    hi! other!then go to be and yes!


    so I would want text1 to look like
    hi!
    other!then
    yes!
    Last edited by newprogram; Aug 26th, 2007 at 02:46 AM.
    Live life to the fullest!!

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: how to grab every word that has the ! in it

    Code:
        Dim Str As String
        Str = "hi! other!then go to be and yes!"
        If InStr(Str, "!") <> 0 Then
            Text1.Text = Join(Filter(Split(Str, Space(1)), "!"), vbNewLine)
        End If

  3. #3

    Thread Starter
    Fanatic Member newprogram's Avatar
    Join Date
    Apr 2006
    Location
    in your basement
    Posts
    769

    Re: how to grab every word that has the ! in it

    No I want it to grab the text off what in webbrowser1 , so at let say www.mysite.com I want to read that webpage and if any thing with the ! in it to put in text1
    Quote Originally Posted by jcis
    Code:
        Dim Str As String
        Str = "hi! other!then go to be and yes!"
        If InStr(Str, "!") <> 0 Then
            Text1.Text = Join(Filter(Split(Str, Space(1)), "!"), vbNewLine)
        End If
    Last edited by newprogram; Aug 26th, 2007 at 03:01 AM.
    Live life to the fullest!!

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

    Re: how to grab every word that has the ! in it "good rating for answer"

    so read the source into a string Str
    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

  5. #5
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Re: how to grab every word that has the ! in it "good rating for answer"

    Code:
    Dim Str As String
        Str = Inet1.OpenURL(Text1.Text)
        If InStr(Str, "!") <> 0 Then
            Text2.Text = Join(Filter(Split(Str, Space(1)), "!"), vbNewLine)
        End If
    Add an inet control onto your form. Taken from jcis's code etc.

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