Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 3rd, 2006, 01:53 PM
Registered User
Join Date: Mar 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!

Reply With Quote
  #2 (permalink)  
Old April 4th, 2006, 03:31 PM
Registered User
Join Date: Mar 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

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!

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

All times are GMT -4. The time now is 11:48 PM.

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