At work, I have lots of emails, appointments, and contacts I would like to save or reference in Obsidian. Linking a person in obsidian with the contact you have in outlook is quite useful but creating those kinds of links for obsidian is a bit problematic. I find out a walkaround that works for me.
There are several problems:
- Since Office 2007 “Outlook:” links don’t work.
- Even if they work, you have to reference an individual item and you don’t know the id.
- It has to be easy to do, like pressing a button.
- For the first problem, you need to modify the registry. Here you have a link with not only the modifications but also some files to do it automatically.
- When it comes to the second point, I come out with some code to be implemented as a macro in Outlook (thanks to link):
Function SetClipBoardText(ByVal Text As Variant) As Boolean
SetClipBoardText = CreateObject(“htmlfile”).ParentWindow.ClipboardData.SetData(“Text”, Text)
End Function'Adds a link to the currently selected message to the clipboard
Sub ObsidianLink()Dim objMail As Object
Dim txtObsLink As String
Dim exito As Boolean’ 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 IfSet objMail = Application.ActiveExplorer.Selection.Item(1)
If objMail.Class = olMail Then
txtObsLink = “[MESSAGE: " + objMail.Subject + " (” + objMail.SenderName + “)](outlook:” + objMail.EntryID + “)”ElseIf objMail.Class = olAppointment Then txtObsLink = "[MEETING: " + objMail.Subject + " (" + objMail.Organizer + ")](outlook:" + objMail.EntryID + ")" ElseIf objMail.Class = olTask Then txtObsLink = "[TASK: " + objMail.Subject + " (" + objMail.Owner + ")](outlook:" + objMail.EntryID + ")" ElseIf objMail.Class = olContact Then txtObsLink = "[CONTACT: " + objMail.Subject + " (" + objMail.FullName + ")](outlook:" + objMail.EntryID + ")" ElseIf objMail.Class = olJournal Then txtObsLink = "[JOURNAL: " + objMail.Subject + " (" + objMail.Type + ")](outlook:" + objMail.EntryID + ")" ElseIf objMail.Class = olNote Then txtObsLink = "[NOTE: " + objMail.Subject + " (" + " " + ")](outlook:" + objMail.EntryID + ")" Else txtObsLink = "[ITEM: " + objMail.Subject + " (" + objMail.MessageClass + ")](outlook:" + objMail.EntryID + ")"
End If
’ doClipboard.SetText txtObsLink
’ doClipboard.PutInClipboardexito = SetClipBoardText(txtObsLink)
End Sub
- For the last point, you just need to create a button with the macro.
In the end, It works like this:
When you find an item (message, appointment, contact…) that you want to reference in Obsidian, you only need to do two things.
- Press the button you have programed
- Go to obsidian and paste the link
I hope it would be helpful.
David