Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
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 September 1st, 2011, 09:40 AM
Registered User
 
Join Date: Sep 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Word VBA Converting Outline Level Format from Number to Letter

I have one other question about VBA code mostly for a word document. I'm outputting a recordset from Access to Word and that's OK. Then I select a range between 2 bookmarks as I need to see that section of paragraphs to to the 2nd outline level which also works OK. However by default the 2nd outline level uses numbers instead of lower case letters.

I was trying to see if I could change thar for one range of paragraphs rather than apply a style to a whole document. Right now this is what my code is doing:


Code:
       WordObj.ActiveDocument.Range(WordObj.ActiveDocument.Bookmarks("MMPBodyStart").Range.Start, WordObj.ActiveDocument.Bookmarks("MMPBodyEnd").Range.End).Select

     For Each P In WordObj.Selection.Paragraphs
        If Left(P.Range.Text, 10) = "Failure to" Then
            P.Format.LeftIndent = InchesToPoints(1.25)
            P.Range.SetListLevel Level:=2
            P.Range.ListFormat.ApplyNumberDefault
        End If
    Next
This all works fine but for these paragraphs only instead of

1)
2)

etc

I was hoping to get

a)
b)

etc
Any suggestions without having to create a whole style?
 
Old September 4th, 2011, 10:36 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Can you try with

Code:
P.Range.ListFormat.ApplyOutlineNumberDefault
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
The Following User Says Thank You to Shasur For This Useful Post:
bmcellis (September 6th, 2011)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Display Outline Format from Nested XML Structure tclotworthy XSLT 2 May 16th, 2007 03:43 PM
Function to find if a letter is in a word jfrizelle Access VBA 2 January 29th, 2007 05:44 PM
VBA SQL import from Excel number format aem Excel VBA 0 January 19th, 2005 02:28 AM
Converting a string to a number steve456 Javascript How-To 2 November 17th, 2003 06:01 PM





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