Embedding custom links into a Word Document

There was recently a question on the MacEnterprise mailing list about embedding a clickable smb link into a Microsoft Word document, and it got me thinking - Word only sees fit to support 3 different types of URIs. Hyperlinks to other documents, links to web pages, and email addresses. But what If we want to include a link to a path in a fileshare? Whether that’s smb, afp, nfs, etc, Word does not support it. When I choose to link to a ‘web page’, Word mangles my URI to look like this:

file://localhost/smb/::fileshare.example.com

instead of the proper syntax as I typed it in (smb://fileshare.example.com)…
It assumes I meant to link to a document.

So, how to fix this? Well, it involves a bit more work than it should. First, create a html file that contains just a link to your URI:

<html>
<body>
<a href="smb://fileshare.example.com">example link</a>
</body>
</html>

Then, open up your work document and choose Insert > File. Make sure you choose to the Enable All Readable Documents in the dropdown box. Select your html file, and viola! You now have an embedded URI that does not conform to Microsoft Word’s expectations.

 
1
Kudos
 
1
Kudos

Now read this

Migrating User Home Folders

Today at work I developed a script to migrate users to a new home folder. This was done with automation in mind – every user will now have the same home folder name (but individual RealNames) so that scripts can be deployed without... Continue →