With new features such as iframes and application URIs, there are more opportunities to integrate Obsidian with external apps and files. Here are some options with Microsoft OneDrive and 365 (formerly Office) files.
Iframe Embed
For those not familiar with iframes, they are an html tag that allows you to embed one webpage into another. Many web apps and cloud storage services provide the iframe embed code with special widgets for file interaction.
In OneDrive, you can right-click or select a file and choose Embed
to get the iframe code. There are also additional embed options depending on the file type.
The
<iframe>
code can be copied directly into an Obsidian note and will render in preview mode.
But in OneDrive embeds, files are not editable . . .
File Link
Since OneDrive embeds are not editable, you may want to open the file from Obsidian. For those who have used Microsoft OneNote, you are familiar with this - you can view the static Excel or Word document in your note, but you need to double-click to open and edit.
The first option would be to use the file link from OneDrive. This will open the file in the āonlineā app. But now that Obsidian supports application URIs, you can create a link that will open the file in the Microsoft desktop app (I prefer this). This is an extra step, and you cannot use the OneDrive āID-basedā link.
You must use the OneDrive āpath-basedā link, which has this schema:
https://d.docs.live.net/[account ID]/[account path]/[filename with extension]
https://d.docs.live.net/1234567890/Documents/Files/my_excel_workbook.xlsx
Spaces in URLs must be replaced with %20
.
You can also get the āpath-basedā file location in the desktop app by going to File
and right-clicking a file or going to Info
for the current file.
To open this file in the Microsoft desktop app, you must prepend the URL with the Office URI scheme for the app you are using. More info here https://docs.microsoft.com/en-us/office/client-developer/office-uri-schemes. For our above example, this URI would open the file in the Microsoft Excel desktop app:
ms-excel:ofe|u|https://d.docs.live.net/1234567890/Documents/Files/my_excel_workbook.xlsx
Other Link Options
- It is also possible to use the
file:///
URI scheme to open the local file, but this would not be portable across devices, and itās more of a pain to generate. In this case, our link would be:
file:///C:/users/username/OneDrive/Documents/Files/my_excel_workbook.xlsx
- There is a very new Windows feature where you can set links to use the desktop app by default without prepending the URI scheme, but I could not get that to work. https://support.microsoft.com/en-us/office/open-file-links-directly-in-office-desktop-apps-fe241745-9e05-4142-9ba8-1bb1dc044773
Putting this together in Obsidian
Obsidian doesnāt recognize many non-md files, including Microsoft 365 files. Personally, Iām okay with that because Iāve developed a compromise solution that I think takes advantage of Obsidian features while not bloating my vault and maintaining flexibility on where I save files.
For files that I use in conjunction with Obsidian notes, I create a āwrapperā note for that file.
Now we can link or embed this āfileā note into a working note.
And now I get all of Obsidianās link, graph and search features to see where this file is being used. I can also use my wrapper note to apply additional tags, links and metadata to the file.
Conclusion - Still a WIP
Iām still experimenting with these workflows, but given that this is very similar to the file interaction in OneNote, this feels sustainable. I could foresee a script or future plugin to automate iframe, link, and note creation. I also wonder about the āfile wrapper noteā as a conceptual template for working with other non-md files.