Results 1 to 6 of 6

Thread: Remove hyperlink

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Posts
    89

    Unhappy

    How to write a program remove hyperlinks in a email message. The extension of the mail is ".EML".?
    Thank You!

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Open the email file in notepad and get to know the tag it uses to specify a hyperlink, i.e. the keyword immediately precedingand following the hyperlink. Once you get the keywords, open any file of same type and do a search for the keywords using Instr or any other function which you know which returns position of the searched word. Anything between the keywords that you had earlier known would be a hyperlink so replace the string, including both the keyword with empty string(just "").

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Posts
    89
    I don't understand. Do you have the source code. I am just a beginner. Thank You

  4. #4
    Junior Member
    Join Date
    Mar 2001
    Posts
    19

    Smile

    I think what he means is you need to figure out what the tags look like. i.e <blah blah blah> or whatever that you want removed.

    then just load the letter into a Rich Text Box RTB.LoadFile

    Find the location of the first tag: x = inStr(RTB.Text, "<blah blah blah>")
    Then the second Tag: y = InStr(x + 1, RTB.text, </blah blah blah>)
    Find the closing bracket of the second tag: z = inStr(y, RTB.Text, ">")
    then make a temporary string with the value of the entire tag: tempString = Mid(RTB.Text, x, z - x + 1)
    Then just erase the undesired string: Replace(RTB.Text, tempString, "")

    That's it.
    "He who angers you conquers you." - Elizabeth Kenny

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Posts
    89

    Doubts

    Thank You very much Aries ! Your method works for one link.
    However, there are more than one link in the text file
    How do I remove all of them? Do you know how to read
    line by line. Can you teach me how to do it. What function of methods is to be use?

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    look at your other thread that I just posted to...that may help
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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