Results 1 to 3 of 3

Thread: Search for text, then return next 20 characters

  1. #1

    Thread Starter
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Post your code and I can probably figure it out.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Drop three textboxes on your form and try the following.
    Text1.text = "are"
    Text2.text = 5
    Text3.text = "How are you today? are you fine?"

    Place this in a command button.
    Code:
      Dim int_Pos As Integer
      Dim int_X As Integer
      For int_X = 1 To CInt(Text2.Text)
        int_Pos = int_Pos + 1
        int_Pos = InStr(int_Pos, Text3.Text, Text1.Text)
        If int_Pos = 0 Then Exit Sub
        MsgBox Mid(Text3.Text, int_Pos + Len(Text1.Text), 50)
      Next
    Text1 = the word or phase you are looking for
    Text2 = the cycle
    Text3 = to your text files

    Tell me if you need anything else.
    Chemically Formulated As:
    Dr. Nitro

  3. #3
    New Member
    Join Date
    Sep 2000
    Location
    Mobile AL
    Posts
    4
    Thanks
    Works Great

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