p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Word VBA (http://p2p.wrox.com/forumdisplay.php?f=231)
-   -   Listlevel help (http://p2p.wrox.com/showthread.php?t=40722)

ambrosia April 3rd, 2006 01:53 PM

Listlevel help

I got this script from a "convert Word2Wiki" topic. Basically, it inserts '#' a number of times based on listlevel in the beginning of every list paragraph.

Private Sub ConvertLists()
   Dim para As Paragraph
    For Each para In ActiveDocument.ListParagraphs
        With para.Range
            .InsertBefore " "
            For i = 1 To .ListFormat.ListLevelNumber
                If .ListFormat.ListType = wdListBullet Then
                    .InsertBefore "*"
                    .InsertBefore "#"
                    Selection.ParagraphFormat.OutlineLevel = Selection.Range.ListFormat.ListLevelNumber

                End If
            Next i
        End With
    Next para
End Sub

I dont really understand the steps in the procedure, but.. how do we:

Also enclose each list paragraph with a '#' in the end?
And/or give it a different style based on listlevel instead of it being a list.
I hope this isn't much of a trouble. Much of my prob is where to input changes in the script.

Thank you!

ambrosia April 4th, 2006 03:31 PM

Omigosh, once again, I'm compelled to answer my own question!!!!

I'm working on a bulleted list. But, if I press tab, it usually does not change in body level. I know now that I can "link" a particular list level(created when tab is pressed another of time) to a different style and imbue this style with the right level. Thanks for reading anyway!!!!! I hope to make everybody's life easier!

All times are GMT -4. The time now is 03:02 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.