Code:
Dim strHTML As String
Dim intStartPos As Integer
Dim intEndPos As Integer
strHTML = "<A href=""mailto:[email protected]?subject=hello"">"
' InStr returns the starting position of the "mailto:" string
intStartPos = InStr(1, strHTML, "mailto:")
' Calculate the starting position of the email
' address by adding the length of "mailto:"
intStartPos = intStartPos + Len("mailto:")
' I don't know much about HTML, so I'm going to assume
' that the "?" will always follow the email address,
' so this locates the "?"
intEndPos = InStr(intStartPos, strHTML, "?")
MsgBox Mid$(strHTML, intStartPos, intEndPos - intStartPos)
' If the "?" is not always there, then you can create similar
' code to look for .com, .edu, .org, .gov instead