edmacey
asked on
Replace hyperlink
Dear BlueDevilFan,
I hope that you will be able to help with this one as well, when the email is sent out, the text from the notes does this to any email address which is in the text
HYPERLINK "mailto:ed.macey@iptdesign .co.uk" ed.macey@iptdesign.co.uk
are you able to remedy this as quickly as you did with the line breaks?
Thanks Ed.
I hope that you will be able to help with this one as well, when the email is sent out, the text from the notes does this to any email address which is in the text
HYPERLINK "mailto:ed.macey@iptdesign
are you able to remedy this as quickly as you did with the line breaks?
Thanks Ed.
Private Sub project_Write(Cancel As Boolean)
Dim projectNotes As String
projectNotes = project.Body
If originalprojectNotes <> projectNotes Then
originalprojectNotes = projectNotes
Set mail = Application.CreateItem(olMailItem)
mail.Subject = "" & project.Subject & " notes have been updated"
mail.HTMLBody = "<font face='arial' colour='#000080' size='2'><p>" & project.Subject & " has been updated. The current notes are:</p><p> " & Replace(projectNotes, vbCrLf, "<br>") & "</p>><p><font size = '1'>V. 1 - /4501/</p>"
mail.To = "edmacey@iptdesign.co.uk"
mail.Send
End If
ASKER
Yes, sorry, it is form the projectNotes variable.
Will the address always be your address?
ASKER
no the notes change so it's just every occasion whenever those notes have an email address in, it does that. the notes are for various different tasks.
Ok. Let me see what I can figure out.
ASKER
I've thought of a way of fixing this if you can write into the code to delete HYPERLINK and then "this@email.com" then it would get rid of the offending text. Whatever the email address is it is always surrounded by " " so these can be the markers. What do you think?
So look for the second double quote (i.e. ") after HYPERLINK. Delete from the beginning of HYPERLINK through the double quote, right?
ASKER
yeah exactly that. HYPERLINK "mailto:ed.macey@iptdesign .co.uk" ed.macey@iptdesign.co.uk so that just the second instance of the email address is left, hyperlink and everything contained in the double quotes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks again, this works fantastically
You're welcome, Ed.
I take it that the link is part of the text in the projectNotes variable. Is that correct?