none
Using document styles as values in drop-down in Word 2013

    Question

  • Hi,

    I am totally new to VBA and XML but reading around this excellent forum I think my idea is possible using a combination of these two techniques....

    OBJECTIVE: Generate drop down menus that dynamically reads in text in a certain style (Heading2) within a single document as properties of the drop down.

    Basically I have been tasked with streamlining a documentation process at work. The document contains a number of 'issues' (sections of normal text) headed with a 'issue' title (that is normally in a Heading2 style).

    At the start of the document there is a table detailing all the 'issues' within the document. Currently this table has to be manually populated by duplicating all the 'issue' titles into the table, along with its section reference number. 

    What I would like is for the table to have a single line to start with, with a drop down box in the first column that, when activated, reads in the 'issue' titles as properties for the dropdown.

    Is this possible? If so any guidance is gratefully received.

    Thanks in advance, MattG.


    Friday, February 08, 2013 4:52 PM

Answers

  • Hi Matt

    So, basically you want to "filter" the TOC in the Reference table? Let the user select one issue (from text formatted with Heading 2) and then all the Items for the select issue will be listed?

    Before you put in all that effort, this being Word 2013, have you and the client looked at the functionality to collapse the headers? This document could open with only Heading 1 showing for the entire document. Hovering the mouse over the header will display an "arrow" in the left margin. Click that to expand that header. See this blog article
    http://blogs.msmvps.com/wordmeister/2012/09/05/collapsing-and-expanding-headingsoutline-levels/


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, February 18, 2013 4:14 PM

All replies

  • Hi Matt

    Just out of curiousity, why wouldn't "you" create a TOC (Table of contents) that references only Heading 2 to generate this list at the top of the document?

    What would be the purpose of the dropdown? Populating such a list would certainly be possible, but before we all got the trouble of working it out, I'd feel better knowing that the effort is going to be worthwhile :-)?


    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, February 09, 2013 8:26 AM
  • I dont think a TOC will work unless you can remove the section title number leaving just header text and each line within the TOC can be inserted into a new line within a custom table.

    My document layout would be similar to this:

    1. Title Page
    2. TOC
    3. Reference Table (See below)
    4. Items Section
    • Item1 (Header)
    • Item2 (Sub Header)
    • Text about Item1
    • Item2 (Header)
    • Item2 (Sub header)
    • Text about Item2
    • Item3 (Header)
    • Item3 (Sub Header)
    • Text about Item3

    ________

    For the Reference Table the columns required are:

    Headers   Sub Headers Section Number
    Item1 Item1 Sub Header 4.1
    Item2 Item2 Sub Header 4.2
    Item3 Item3 Sub Header 4.3

    I can only think drop downs are the way forward to generate the line items in the Headers and Sub Headers columns - but your guidance is much appreciated.... KR Matt



    • Edited by MattGough Saturday, February 09, 2013 10:19 AM Formattted table better
    Saturday, February 09, 2013 10:09 AM
  • Hi MattGough,

    Thanks for posting in the MSDN Forum.

    I think you'd better provide a screen shooting for your document to clarify your goal more clearly. I think your document is a bit complex, it's hard to catch your wish.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 11, 2013 6:06 AM
  • Hi Matt

    So, basically you want to "filter" the TOC in the Reference table? Let the user select one issue (from text formatted with Heading 2) and then all the Items for the select issue will be listed?

    Before you put in all that effort, this being Word 2013, have you and the client looked at the functionality to collapse the headers? This document could open with only Heading 1 showing for the entire document. Hovering the mouse over the header will display an "arrow" in the left margin. Click that to expand that header. See this blog article
    http://blogs.msmvps.com/wordmeister/2012/09/05/collapsing-and-expanding-headingsoutline-levels/


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, February 18, 2013 4:14 PM
  • Cindy (or anyone else who can help),

    In the above post, you stated "why wouldn't "you" create a TOC (Table of contents) that references only Heading 2 to generate this list at the top of the document".  Do you know how you do this? 

    I have a lengthy document with Heading 1 for the chapter headings and heading 2 for the headings within Chapter 2, heading 3 for the headings within chapter 3, etc.  I have a TOC at the beginning of the textbook with Heading 1 and index at the end with everything.  However, I would really like to have a TOC at the beginning of each Chapter that has just heading 2.  I can't find a way in 2013 to skip a level in a heading.  It seems you can have levels 1, 1-2, 1-3, etc.  I just can't find a way to do just level 2 or just level 3.  Any ideas?  Thanks.

    Laurie

    Wednesday, December 11, 2013 12:51 AM
  • Hi Laurie

    The best place for you to ask this would be an end-user forum, since it appears there's no programming involved? You'll find a lot more people who work with Word in this manner at

    http://answers.microsoft.com/en-us/office/forum/word

    Be sure to mention which version of Word you're working with.

    Without knowing the version your using and doing a lot of research for something I don't use regularly, all I can tell you is, yes, you can set up a TOC to work with any specific set of styles (including the Heading styles). By default, you'll get Heading 1, Heading 2 and Heading 3. Once you're in the Insert Table of Contents dialog box, click the Options button to get the list of styles you can use.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, December 13, 2013 4:38 PM