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.
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.
<iframe>code can be copied directly into an Obsidian note and will render in preview mode.
But in OneDrive embeds, files are not editable . . .
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]
Spaces in URLs must be replaced with
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:
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:
- 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.