Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-23-2021, 09:52 AM
jeffreybrown jeffreybrown is offline Convert document to a multilevel list Windows 10 Convert document to a multilevel list Office 2016
Expert
Convert document to a multilevel list
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default Convert document to a multilevel list

I found this macro below that I thought might help, but it appears this macro is looking at a document that already has auto numbering applied.



The document I have is in outline from with a numbering sequence of I., A., 1., a., but it is all manually entered. All paragraphs in the outline are either Normal or List Paragraph.

How can I get this entire document to have a multilevel list applied so I can adjust if needed afterwards?

https://www.msofficeforums.com/word-...numbering.html
Attached Files
File Type: docx T.docx (28.3 KB, 8 views)
Reply With Quote
  #2  
Old 10-24-2021, 03:49 AM
gmayor's Avatar
gmayor gmayor is offline Convert document to a multilevel list Windows 10 Convert document to a multilevel list Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Frankly this is a horribly formatted document, with paragraph breaks instead of line wrapping, multiple tabs and, as you concede, manual numbering schemes. It works as it is, but there is no easy way to deal with changing the formatting to use autonumbering. It would take longer to figure out a macro to cope with all the anomalies than it would to reformat manually, using the existing Heading styles to set the levels, which you can then format to give the appearance you need.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 10-24-2021, 07:12 AM
jeffreybrown jeffreybrown is offline Convert document to a multilevel list Windows 10 Convert document to a multilevel list Office 2016
Expert
Convert document to a multilevel list
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi Graham and thank you for your time. Yes, agreed. The formatting is horrible, but this is what I have to work with. As far as all the other formatting, I can take care of that, just really trying to understand the application of the Heading styles. Here is a cleaned up document and the macro I cobbled together which of course does not work entirely. This is just a shortened version of a 9 page document and then there are another 3 to format. Manual of course is an option, but not one I'm excited about. Can you give some suggestion on this macro and how it can be fixed to cover all of the letter/number combinations?

Code:
Sub ConvertStyle()
    Dim orng        As Range: Set orng = ActiveDocument.Range
    Dim opara       As Paragraph
    Dim oParRng     As Range
    Dim MyLtr       As String
    Dim MyStyle     As String
    
    For Each opara In orng.Paragraphs
        Set oParRng = opara.Range.Duplicate
        MyLtr = oParRng.Characters(1)
            
        Select Case MyLtr

            Case "I", "II", "III", "IV", "V", "VI": opara.Style = "Heading 1"
            Case "A", "B", "C", "D", "E", "F": opara.Style = "Heading 2"
            Case "1", "2", "3", "4", "5", "6": opara.Style = "Heading 3"
            Case "a", "b", "c", "d", "e", "f": opara.Style = "Heading 4"
            
        End Select
            
    Next opara
    
lbl_Exit:
    Exit Sub
End sub
Attached Files
File Type: docx T.docx (25.1 KB, 8 views)
Reply With Quote
  #4  
Old 10-24-2021, 02:33 PM
macropod's Avatar
macropod macropod is offline Convert document to a multilevel list Windows 10 Convert document to a multilevel list Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by jeffreybrown View Post
I found this macro below that I thought might help, but it appears this macro is looking at a document that already has auto numbering applied.

...

https://www.msofficeforums.com/word-...numbering.html
Post #2 in that thread has a link to a macro that converts manual numbering to auto numbering.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-25-2021, 09:44 AM
jeffreybrown jeffreybrown is offline Convert document to a multilevel list Windows 10 Convert document to a multilevel list Office 2016
Expert
Convert document to a multilevel list
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Thank you Paul and Graham. I sure missed that part about the manual numbering.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross-reference with full context a numbered list inside another multilevel list (list style) MatLcq Word 0 02-01-2021 06:00 AM
Convert multilevel bullet list to multilevel numbered list scadaman29325 Word 2 03-27-2020 03:27 PM
Convert document to a multilevel list convert multilevel list to a true outline markjkubicki Word 3 10-17-2018 10:12 AM
How to convert table into multilevel list? microsoftsloot Word 1 12-07-2015 10:55 PM
Convert document to a multilevel list Multilevel List leaderofmarines Word 2 07-02-2013 05:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:30 PM.


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