How to create a link to a location in the body of an email in outlook 365

In Outlook 2016, you can create links to webpages, new or existing files on your computer, email addresses, and to specific locations in a document.

Inserting a hyperlink

On the Home tab, click New Email.
In the body of the email, select the text or picture that you want to display as the link. On the Insert tab, choose Link > Insert Link.
Choose one of the following:

Existing File or Web Page – Select an existing file or enter a web page URL in the Address box.
Place in This Document – Select the heading that you want to link to.
Create New Document – Type a Name for the new document. You can choose to create the file in the location displayed in Full path or click Change to browse to a different location. Choose Edit the new document later or Edit the new document now.
E-mail Address – Type the recipient’s email address in the E-mail address box or select an address from the Recently used e-mail addresses list. Type the subject of the message in the Subject box.

Editing a hyperlink

If you need to change an existing link, right-click the link and select Edit Hyperlink. In the Address box, edit the link and click OK.

Deleting a hyperlink

To delete an existing link, right-click the link and select Remove Hyperlink.

You can do this with a little bit of code in Outlook and a little bit of code in Emacs.

First, if you're using Outlook 2007 you'll need to enable Outlook URLs with a registry addition. Instructions and the registry file can be found here courtesy of David Tan.

Next, this macro can be added to Outlook and will get the GUID of the current email message, create a Org-Mode link and deposit it into the clipboard.

'Adds a link to the currently selected message to the clipboard
Sub AddLinkToMessageInClipboard()

   Dim objMail As Outlook.MailItem
   Dim doClipboard As New DataObject

   'One and ONLY one message muse be selected
   If Application.ActiveExplorer.Selection.Count <> 1 Then
       MsgBox ("Select one and ONLY one message.")
       Exit Sub
   End If

   Set objMail = Application.ActiveExplorer.Selection.Item(1)
   doClipboard.SetText "[[outlook:" + objMail.EntryID + "][MESSAGE: " + objMail.Subject + " (" + objMail.SenderName + ")]]"
   doClipboard.PutInClipboard

End Sub

As koushik noted in the comments, the doClipboard.SetText part can be expanded to differentiate between different item types:

If objMail.Class = olMail Then
    doClipboard.SetText "[[outlook:" + objMail.EntryID + "][MESSAGE: " + objMail.Subject + " (" + objMail.SenderName + ")]]"
ElseIf objMail.Class = olAppointment Then
    doClipboard.SetText "[[outlook:" + objMail.EntryID + "][MEETING: " + objMail.Subject + " (" + objMail.Organizer + ")]]"
ElseIf objMail.Class = olTask Then
    doClipboard.SetText "[[outlook:" + objMail.EntryID + "][TASK: " + objMail.Subject + " (" + objMail.Owner + ")]]"
ElseIf objMail.Class = olContact Then
    doClipboard.SetText "[[outlook:" + objMail.EntryID + "][CONTACT: " + objMail.Subject + " (" + objMail.FullName + ")]]"
ElseIf objMail.Class = olJournal Then
    doClipboard.SetText "[[outlook:" + objMail.EntryID + "][JOURNAL: " + objMail.Subject + " (" + objMail.Type + ")]]"
ElseIf objMail.Class = olNote Then
    doClipboard.SetText "[[outlook:" + objMail.EntryID + "][NOTE: " + objMail.Subject + " (" + " " + ")]]"
Else
    doClipboard.SetText "[[outlook:" + objMail.EntryID + "][ITEM: " + objMail.Subject + " (" + objMail.MessageClass + ")]]"    
End If

Almost there, add this little bit of lisp to your emacs lisp directory to enable Outlook links.

;;; org-outlook.el - Support for links to Outlook items in Org

(require 'org)

(org-add-link-type "outlook" 'org-outlook-open)

(defun org-outlook-open (id)
   "Open the Outlook item identified by ID.  ID should be an Outlook GUID."
   (w32-shell-execute "open" (concat "outlook:" id)))

(provide 'org-outlook)

;;; org-outlook.el ends here

And lastly, update your .emacs file to include the Outlook link code. Just add this somewhere after org-mode is setup.

(require 'org-outlook)

Now you can call the macro (I added it to my toolbar in Outlook for quick access) and you can quickly create a link to the email in Emacs.

One gotcha, GUID's change when you move a message between document stores, so if you get the GUID to the message while it's on your Exchange server and then move it to your local PST file the link will change. Move the message before you get the GUID.

Start by highlighting the text you want to link, and then:

– Right-click and select Hyperlink from the menu.

– Go to the Insert tab and select Hyperlink.

– Press Ctrl + K.

Any of those options will bring up the Insert Hyperlink window, where you can enter your desired URL in the Address field.

How to create a link to a location in the body of an email in outlook 365

In the Outlook Web App, highlight the text you want to link and then click the Insert Link button () and enter the URL in the Insert link box that appears.

Depending on the size of your window, you may need to click the down arrows (shown in the image below on the far right) in order to access the Insert Link button.

How to create a link to a location in the body of an email in outlook 365

Create a hyperlink to a location on the web Select the text or picture that you want to display as a hyperlink. Press Ctrl+K. You can also right-click the text or picture and click Link on the shortcut menu. In the Insert Hyperlink box, type or paste your link in the Address box.
Inserting Bookmarks and Hyperlinks.
First, type your message and write out your index as well..
Go to a location that you want your users to jump to and choose; ... .
Type a name for the bookmark and press Add. ... .
Now select the text in the index that you want the receiver to click on..
Choose; Insert-> Hyperlink..