At first I was going to ask this question: How to convert a Windows Folder tree into a Word Outline?

But really my question is more general and that is only one way I thought to do it. Let me explain my problem:

I have a large shared tree of folders and files. I want to do a conceptual review of the structure, reorganizing it and weeding out things so that it is easier to traverse and use.

What I want is something where it is very easy to do structural editing of the folder tree, but not in situ, i.e., not on the live folder tree. My intent is to plan a new simplified structure, get buy-in from my colleagues, and then migrate to it.

The best tool I've found for doing hierarchical structure planning and experimenting is the outline view in Word. It lets me easily collapse & expand sections, move entire sub-trees around, etc. Hence my initial (but unsuccessful) search for an easy way to get a Word outline format of the folder tree so I could take advantage of Word's outline processor.

Now, I know there is the tree command-line tool in DOS that will give me a pretty picture of the tree using the special characters or ASCII characters and I know that I can redirect the output of that into a file or other program. But it is singularly unsuited to creating a file that I can easily use in Word for my purposes.

So I'm looking for any guidance towards solving my problem. It could be along the lines of my original search, i.e. how to convert a folder structure into a Word Doc of headings suitable for outline processing? Or any other ideas about how to do planning of changes to a very large and complex existing folder hierarchy.

1 Answer 1


This approach may be a bit janky, but it'll build upon the resources you've presented so far, and give you the hierarchical view in Word. It shouldn't take you too long once you get the hang of it.

You can copy the tree structure generated in command line into Word, and then use the Find and Replace function to apply a style (eg. heading level) to all folders at the same (sub-folder) level at the same time. You then repeat this for each folder level to generate the complete outline view. As an example,

  1. Using the command-line Tree /a > FolderStructure.txt, you can generate the directory tree structure in a file and copy it over to Word, resulting in something similar to:
|   +---2018
|   \---2019
|       +---Completed
|       \---Temp
|   +---2018
|   \---2019
  1. Open the Replace dialog (Ctrl+H) in Word. In the Find What: text box, copy and paste all the characters on the line before a folder name, eg."| +---" (everything in front of the folder name "Completed.") Make sure you start at either the top level or the lowest level (lowest strongly recommended.)
  2. Click on the "More >>" button in the dialog window to expand the available options.
  3. Since there are 2 ways a folder can be prefixed in the Tree output ("+---" and "\---"), you can use the "wildcard" option by enabling the "Use Wildcards"checkbox option in the expanded options, and use "?" to make sure that both types of prefixes can be found. Replacing "+" or "\" with "?", the Find what: text box should look like "| ?---"
  4. Move the cursor to the Replace with: text box. You can put a space bar here to replace the text at the same time, or leave it blank and just change the heading style now and deal with the text later. Click on the "Format" dropdown menu and select "Style..."
    Find and Replace Dialog
  5. In the "Find Style" dialog box that pops up, select the style you want to use. Since the folder "Completed" is 3 levels down, you can try "Heading 3". Hit the "OK" button to confirm the selection, under Replace with: there should now be "Format:" and "Style: Heading 3"
    Replace With: dialog box with Format: option
  6. Click on the "Replace All" button and all folders that are 3 sub-levels down will now be converted to the "Heading 3" style.
  7. Repeat this with folders at the other sub-levels going up (or down) the folder structure, one level at a time.

If you want to replace/delete the prefixed text completely without leaving behind a space. You need to run the replace operation twice. 1st time with only the formatting style in the Replace with: field, leaving the text box blank. After you hit "Replace All" and changed the style, move the cursor back to the Replace with: text box, click on "no formatting" at the bottom to remove the formatting, and click on "Replace All" a second time.

Using this, you should be able to recreate your directory structure as a Word outline. Folder structure in Word Outline

  • Thanks! I am going to try this and let you know how it works.
    – yosh m
    Oct 29, 2019 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.