Thread: Listlevel help
View Single Post
  #1 (permalink)  
Old April 3rd, 2006, 01:53 PM
ambrosia ambrosia is offline
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listlevel help

Hello!

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 "*"
                Else
                    .InsertBefore "#"
                    Selection.ParagraphFormat.OutlineLevel = Selection.Range.ListFormat.ListLevelNumber

                End If
            Next i
            .ListFormat.RemoveNumbers
        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!

Reply With Quote