Insert hyperlink into Outlook message without HTML

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. Windows
Is it possible to insert a hyperlink with a friendly name in the body of an Outlook message without using HTML?

I have a range of Cells that contain web addresses and I want to be able to add them to the message body but with a friendly name is possible to cut down on the body size. The reason I want to avoid HTML is because the code I already have to create the message is quite large and does not use HTML, so to change it would be a lot of work I think?

If I have to use HTML then so be it, but if I can avoid it that would be my preference.

Further, the code I'm using automatically converts the cell value to a hyperlink, (because it's a https address), but I want to be able to give it a friendly name so if there is a simple way to achieve it then that would be great.
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Let's assume that cell A2 contains a hyperlink, maybe something like this...

Code:
Sub test()    

    Dim olApp As Object
    Dim olMailItem As Object
    
    Set olApp = CreateObject("Outlook.Application")
    Set olMailItem = olApp.CreateItem(0)
    
    Range("A2").Copy
    With olMailItem
        .Display
        .to = "john.smith@gmail.com"
        .Subject = "Misc"
        .body = "This is the body of the email..."
        With .GetInspector.WordEditor
            .Application.Selection.EndKey Unit:=6 '6 = wdStory
            .Application.Selection.TypeParagraph
            .Application.Selection.Paste
            .Hyperlinks(.Hyperlinks.Count).TextToDisplay = "Friendly Name"
        End With
    End With
    
    Set olApp = Nothing
    Set olMailItem = Nothing
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top