locked
How to place TOC into a different frame in an HTML document? RRS feed

  • Question

  • I'm now using MS Word 2010 to update a document that I originally created in MS Word 2003.

    I want to create a TOC in a separate frame positioned to the left of the frame that contains the text of the document.  Using help from Technet I've been able to figure out how to create the frame.  If I try to create the TOC in the left frame I receive an error to the affect that there is no text to process.  If I create the TOC in the main document (right frame) it works fine and you can follow the links to the various headings in the document.  Just what you'd want.  However, when I cut and paste the TOC into the left frame the links become broken.  They seem to end up pointing to themselves which I have a hard time figuring out why anyone would ever want such a result.

    The good news is that when the document is saved in HTML it is done in a form that creates an HTML Frameset which the browser displays just as intended.  However, the reason for doing this is to have the TOC entries end up being hyperlinks which allow navigation to the corresponding references in the document frame.

    The really perplexing part is that this worked just right in Word 2003.  I hope the problem I'm having now is that I forgot precisely how to properly perform the task.  If not this amounts to just another one of many reasons to regret buying an Office Upgrade.  It will definitely be time to abandon Word 2010 and return to using Word 2003 for this kind of work.

    Sunday, January 18, 2015 8:22 PM

Answers

  • I went back to one of my older systems which has Office 2003 installed.  It couldn't be any easier to do than the way Word 2003 works.  I didn't need any special knowledge.  You just select the "Format" menu item.  Then the drop down sub menu contains an item called "Table of Contents in Frame".  You select that and wha-la you get a frame added to the left of the document with a TOC.  Then you save the document as html (I use filtered html as I think that removes some MS Word unique tags that a browser doesn't recognize).  You basically end up with 3 files with names as follows:

    1. your-document-name.htm, which is the file with the frameset that is to be launched by a browser
    2. contents.htm
    3. body.htm

    I'm not sure what happens when name duplication is encountered.  In my case since the document contains graphic files, Word creates a folder named "body_files" and places all of the graphics there.  The contents frame contains links that can be selected in a browser to position to the referenced text.

    Relearning how it works in Word 2003 was helpful to figuring what needed to be done in Word 2010.  It looks like in Word 2010 you need to customize the "Quick Access Toolbar".  Then you need to hunt through all of the available commands where you will find one called, marvelously, "Table of Contents in Frame".  Once you get that command on your toolbar it becomes as easy as it was in Word 2003.

    One has to wonder why Microsoft thinks it is a good idea to make features of prior versions of Word that were so easy to both use and learn so mysterious on a newer version of Word.  It is pure HELL trying to use what is supposed to be an improved product.  This applies to their whole redesign for which I can see absolutely no merit.  Possibly a new user, one who's never experienced Office, might like it but I can't imagine that there are many of those with a past history of using Office who like it.  And then it is REAL HELL for someone like me who is only an occasional user.  Of course one reason I've become an occasional user is that I've completely given up on Microsoft for this very reason and now use LibreOffice for just about everything.  Unfortunately this was a case where I'd done something in the past using MS Word which I couldn't figure out how to do with LibreOffice, so I guess I'll have to give Microsoft credit for something.

    • Proposed as answer by Peter Jamieson Sunday, January 25, 2015 11:05 AM
    • Marked as answer by SnookRed Sunday, January 25, 2015 5:59 PM
    Thursday, January 22, 2015 6:19 PM

All replies

  • I can't say I have ever worked with framesets in Word, but I think what you need to do is to put an { RD } field in the frame that contains the ToC, immediately before the ToC.

    e.g. if you have a 2-frame document with the ToC in the left-hand frame, you will have 3 .docx files on disk (assuming you are saving as .docx) - let's say they are in c:\frames\ and are...

    fs.docx, representing the frameset

    toc.docx, containing the ToC frame

    main.docx, containing your Headings and text.

    Then the toc.docx needs an RD field like this:

    { RD "main.docx" \f }

    (Where the {  } are a pair of the special field code braces that you can insert using ctrl-F9).

    The \f should cause Word to look for the specified fiel in the same folder as the ToC file, or possibly the frameset file, but if you have problems with that you may need to insert the full path with doubled-up backslashes, e.g.

    { RD "c:\\frames\\main.docx" }


    Peter Jamieson



    • Edited by Peter Jamieson Tuesday, January 20, 2015 11:28 AM Added closing quotation marks
    Monday, January 19, 2015 6:13 PM
  • I went back to one of my older systems which has Office 2003 installed.  It couldn't be any easier to do than the way Word 2003 works.  I didn't need any special knowledge.  You just select the "Format" menu item.  Then the drop down sub menu contains an item called "Table of Contents in Frame".  You select that and wha-la you get a frame added to the left of the document with a TOC.  Then you save the document as html (I use filtered html as I think that removes some MS Word unique tags that a browser doesn't recognize).  You basically end up with 3 files with names as follows:

    1. your-document-name.htm, which is the file with the frameset that is to be launched by a browser
    2. contents.htm
    3. body.htm

    I'm not sure what happens when name duplication is encountered.  In my case since the document contains graphic files, Word creates a folder named "body_files" and places all of the graphics there.  The contents frame contains links that can be selected in a browser to position to the referenced text.

    Relearning how it works in Word 2003 was helpful to figuring what needed to be done in Word 2010.  It looks like in Word 2010 you need to customize the "Quick Access Toolbar".  Then you need to hunt through all of the available commands where you will find one called, marvelously, "Table of Contents in Frame".  Once you get that command on your toolbar it becomes as easy as it was in Word 2003.

    One has to wonder why Microsoft thinks it is a good idea to make features of prior versions of Word that were so easy to both use and learn so mysterious on a newer version of Word.  It is pure HELL trying to use what is supposed to be an improved product.  This applies to their whole redesign for which I can see absolutely no merit.  Possibly a new user, one who's never experienced Office, might like it but I can't imagine that there are many of those with a past history of using Office who like it.  And then it is REAL HELL for someone like me who is only an occasional user.  Of course one reason I've become an occasional user is that I've completely given up on Microsoft for this very reason and now use LibreOffice for just about everything.  Unfortunately this was a case where I'd done something in the past using MS Word which I couldn't figure out how to do with LibreOffice, so I guess I'll have to give Microsoft credit for something.

    • Proposed as answer by Peter Jamieson Sunday, January 25, 2015 11:05 AM
    • Marked as answer by SnookRed Sunday, January 25, 2015 5:59 PM
    Thursday, January 22, 2015 6:19 PM