|
-
Aug 26th, 2007, 02:11 AM
#1
Thread Starter
Fanatic Member
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!!
-
Aug 26th, 2007, 02:33 AM
#2
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
-
Aug 26th, 2007, 02:40 AM
#3
Thread Starter
Fanatic Member
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
 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!!
-
Aug 26th, 2007, 04:04 AM
#4
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
-
Aug 26th, 2007, 05:32 AM
#5
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|