Wrox Programmer Forums
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2006, 01:53 PM
Registered User
 
Join Date: Mar 2006
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!

 
Old April 4th, 2006, 03:31 PM
Registered User
 
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.