Insert Text Hyperlink in Body of Email

  • Thread starter Thread starter Sandy Winkelman
  • Start date Start date
S

Sandy Winkelman

What is the correct syntax to turn text into a hyperlink and place it at the curser in an email?

Following is my code. I would like make the words "Visit this site" as the hyperlink and remove web address from the sentence.

Sub InsertLink()
Const sText As String = "Visit this site: https://www.cwmdiecast.com"
On Error GoTo ErrHandler
If TypeName(ActiveWindow) = "Inspector" Then
If ActiveInspector.IsWordMail And ActiveInspector.EditorType = olEditorWord Then
ActiveInspector.WordEditor.Application.Selection.TypeText sText
End If
End If
Exit Sub
ErrHandler:
Beep
End Sub
 
What is the correct syntax to turn text into a hyperlink and place it at the curser in an email?

Following is my code. I would like make the words "Visit this site" as the hyperlink and remove web address from the sentence.

Sub InsertLink()
Const sText As String = "Visit this site: https://www.cwmdiecast.com"
On Error GoTo ErrHandler
If TypeName(ActiveWindow) = "Inspector" Then
If ActiveInspector.IsWordMail And ActiveInspector.EditorType = olEditorWord Then
ActiveInspector.WordEditor.Application.Selection.TypeText sText
End If
End If
Exit Sub
ErrHandler:
Beep
End Sub

Have you tried "Visit <a href="https://www.cwmdiecast.com">this site.</a>" ?
 
Back
Top