Quantcast
Channel: Techaholica
Viewing all articles
Browse latest Browse all 10

Link to a Section inside a Word Document

$
0
0

 

Image you have a massive document full of various sections. This might be an IT policy document for example. In other documents or web pages, you might want to reference the sections inside this document. For example, “See section 6.1.12 of the IT Policy document for more information about requesting new hardware”. Well normally you would just link to the IT document, and then have your users manually navigate to section 6.1.12. Today I would like to show you an alternative which might be more useful to your users.

Here is the general overview:

  1. Save your Word document as a “Single File Web Page (*.mht, *.mhtml)”
  2. Upload this new document to a document library
  3. Open this new document in the browser
  4. Record the URL shortcuts to the various sections within the document

Let’s walk through this process now. In this scenario, I am using Office 2013, SharePoint 2010, and IE 11. If you have a different setup, then the instructions and the outcome might be slightly different.

First create or update your Word document. Make sure your sections are using Heading 1, Heading 2, etc. It’s important to use these formatting options rather than just increasing the font size and bolding the text. Once you have your sections created you can insert a table of contents by clicking the References tab and then the Table of Contents button.

TOC

Here is how the table of contents look in my Word document.

TOCinDocument

Now go to File > Save As and choose “Single File Web Page (*.mht, *.mhtml)”

FileNameMHTML

Upload this new file to your document library and open the file in your browser.

TOCinBrowser

You will notice that the table of content links are now hyperlinks. Click on any of these links, and it will navigate you to that section. Copy the URL from the address bar. This will be the URL you use when you link to this section from other places. For the example, clicking the link to Section 2.1 returns this URL: mhtml:http://myportal/some_site/Documents/My%20Awesome%20Document.mht#_Toc421880472. Notice the “#_Toc421880472” part at the end of the URL. This is the part which specifies which section to navigate to once the page is open. I don’t see any way to predict or to calculate what this number will look like ahead of time, so unfortunately you will need to click each section and record each URL that you want to link to. Also take a look at the “mhtml:” prefix of this URL. I’ve tested navigating to this page both with and without this prefix in IE 11 and Chrome, and this is what I have found:

  • IE 11: Opens in the browser just fine with or without the “mhtml:” prefix.
  • Chrome: With the prefix, it does not work. Without the prefix, it attempts to download the document.

So it looks like IE supports this just fine, but Chrome does not. There might be ways around this, but I haven’t looked into that too much yet. I don’t think this is a huge deal since I’m assuming most people are using SharePoint with IE, but it still may be worth researching more.

Hope this helps!


Viewing all articles
Browse latest Browse all 10

Trending Articles