Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2007
    Massachusetts, USA
    Thanked 0 Times in 0 Posts

    Macro to loop thru docs and list out Title, Para Title and Sub Para-Title


    I have a collection of several hundred MS Word 2010 documents, and, I would like to find a macro that would:
    1. Loop through a folder full of documents.
    2. Find a style by name called "Heading 2 Title" (Main Topic Title in this example).
    3. Find a style by name called "Paragraph Title" (which is the main section title in this example).
    4. Find a style by name called "Paragraph Sub-Title".
    5. Make a list out of these styles sequentially out in a separate document.
    The end result is that I will have a comprehensive listing of all these three levels of styles in one long document.

    Any ideas on the macro needed to make this work?

    Thanks in advance for your suggestions.



  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Melbourne, Victoria, Australia
    Thanked 295 Times in 267 Posts
    Rather than performing a search, I would do this by creating a TOC field to gather the information and combine it with macropod's document loop to extract the info to another document.

    A TOC field like this would get your info
    {TOC \t "Heading 2 Title,1,Paragraph Title,2,Paragraph Sub-Title,3" \n}

    Pasting this result into the target doc could then get your info and you either unlink the field or lock it to stop it updating the information away again.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts