Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 02-01-2024, 01:59 PM
tonykekw tonykekw is offline Pull all lists from document Windows 11 Pull all lists from document Office 2021
Novice
Pull all lists from document
 
Join Date: Jan 2024
Posts: 13
tonykekw is on a distinguished road
Default

"I'll start by asking what is the point of this activity? What is a collection of the list items in Excel going to do for you?"

The point of the activity is to find and organize a bunch of rules that are scattered across the document. Over the span of multiple documents. Having the data on excel was a suggestion. It is not a requirement. To me having the data on a sheet would feel more organized.

It doesn't matter if the data pulled is not by how the paragraphs appear in the document. Pulling the lists themselves would be enough. I am trying to essentially rebuild to pull and rebuild the documents.

Adding an Index is a great idea, having new ideas helps a lot.

I am assuming I would drop the
Code:
With aRng.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = ""
        .Forward = True
        Do While .Execute
            aRng.Start = aRng.Paragraphs(1).Range.Start
Something like this:
Code:
Sub PrintListParagraphsInfo()
    Dim aLP As Paragraph
    Dim aDoc As Document
    Set aDoc = ActiveDocument
    Debug.Print "Total List Paragraphs: " & aDoc.ListParagraphs.Count
    For Each aLP In aDoc.ListParagraphs
        aLP.Range.Select
        With aLP.Range.ListFormat
            Debug.Print "List Type: " & .ListType
            Debug.Print "List String: " & .ListString
            Debug.Print "Text: " & aLP.Range.Text
        End With
    Next aLP
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA script to pull data into existing document Formd Word VBA 4 05-11-2021 03:47 AM
Multiple Multi-Level Lists in Same Document TimGS Word 6 05-15-2018 05:29 AM
Pull all lists from document Multilevel lists - Document starting with second level thara Word 2 05-02-2016 02:37 AM
Pull all lists from document How to have two different numbering lists in a document? saseymour Word 3 09-29-2014 11:30 AM
Several Multilevel Lists in a document Aston Word 4 10-07-2012 01:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft