This VBA macro code for Microsoft Outlook creates a URI for the currently selected item (mail item, calendar item, task) and places it on the clipboard. The URI can then be used in a hyperlink in Outlook, OneNote, etc. to open the given item.
Note: If you move a mail item to a different folder, the link will break.
To install, open the VBA editor in Outlook by clicking on the Visual Basic button in the Developer ribbon. (The Developer ribbon can be added under File->Options->Customize Ribbon.) If there is not currently a module in