PDA

View Full Version : Help Spacing List Text



Writeforaliv
03-15-2014, 04:55 PM
Hello,

I am struggling to find a way to space text in a numerical list. I would like each line of text to appear one line below its corresponding number, with an additional line of space before the next number. I've recorded a macro that changes a normal list to a style I prebuilt. Can anyone help me complete this last step?

Thanks in advance! Below is my recorded macro.

Sub ChangeListStyle()
'
' Change List Style to Slide Number Style
'
'
With ListGalleries(wdNumberGallery).ListTemplates(1).ListLevels(1)
.NumberFormat = "Slide %1"
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = InchesToPoints(0.25)
.Alignment = wdListLevelAlignLeft
.TextPosition = InchesToPoints(0.5)
.TabPosition = wdUndefined
.ResetOnHigher = 0
.StartAt = 1
With .Font
.Bold = True
.Italic = wdUndefined
.StrikeThrough = wdUndefined
.Subscript = wdUndefined
.Superscript = wdUndefined
.Shadow = wdUndefined
.Outline = wdUndefined
.Emboss = wdUndefined
.Engrave = wdUndefined
.AllCaps = wdUndefined
.Hidden = wdUndefined
.Underline = wdUndefined
.Color = wdUndefined
.Size = 12
.Animation = wdUndefined
.DoubleStrikeThrough = wdUndefined
.Name = "Arial"
End With
.LinkedStyle = ""
End With
ListGalleries(wdNumberGallery).ListTemplates(1).Name = ""
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
True, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
wdWord10ListBehavior
End Sub

snb
03-16-2014, 04:34 AM
Can you please add code tags around the VBA code in your post ?
Posting a sample document would help the helpers tremendously.

Writeforaliv
03-16-2014, 12:04 PM
Thank you for responding.

I added tags to the VBA code (I hope in the manner you requested). I also attached a sample document that better illustrates what I hope to accomplish with VBA code. Please let me know if you need additional information.

' Change List Format to Slide Number Style
'
'
With ListGalleries(wdNumberGallery).ListTemplates(1).ListLevels(1) 'Indentifies characteristics of Slide Number list in the ListGallery
.NumberFormat = "Slide %1" 'Indentifies characteristics of Slide Number list in the ListGallery
.TrailingCharacter = wdTrailingTab 'Identifies characteristics of Slide Number List
.NumberStyle = wdListNumberStyleArabic 'Identifies characteristics of Slide Number List
.NumberPosition = InchesToPoints(0.25) 'Identifies characteristics of Slide Number List
.Alignment = wdListLevelAlignLeft 'Identifies characteristics of Slide Number List
.TextPosition = InchesToPoints(0.5) 'Identifies characteristics of Slide Number List
.TabPosition = wdUndefined 'Identifies characteristics of Slide Number List
.ResetOnHigher = 0 'Identifies characteristics of Slide Number List
.StartAt = 1 'Identifies characteristics of Slide Number List
With .Font 'Identifies characteristics of Slide Number List
.Bold = True 'Identifies characteristics of Slide Number List
.Italic = wdUndefined 'Identifies characteristics of Slide Number List
.StrikeThrough = wdUndefined 'Identifies characteristics of Slide Number List
.Subscript = wdUndefined 'Identifies characteristics of Slide Number List
.Superscript = wdUndefined 'Identifies characteristics of Slide Number List
.Shadow = wdUndefined 'Identifies characteristics of Slide Number List
.Outline = wdUndefined 'Identifies characteristics of Slide Number List
.Emboss = wdUndefined 'Identifies characteristics of Slide Number List
.Engrave = wdUndefined 'Identifies characteristics of Slide Number List
.AllCaps = wdUndefined 'Identifies characteristics of Slide Number List
.Hidden = wdUndefined 'Identifies characteristics of Slide Number List
.Underline = wdUndefined 'Identifies characteristics of Slide Number List
.Color = wdUndefined 'Identifies characteristics of Slide Number List
.Size = 12 'Identifies characteristics of Slide Number List
.Animation = wdUndefined 'Identifies characteristics of Slide Number List
.DoubleStrikeThrough = wdUndefined 'Identifies characteristics of Slide Number List
.Name = "Arial" 'Identifies characteristics of Slide Number List
End With
.LinkedStyle = ""
End With
ListGalleries(wdNumberGallery).ListTemplates(1).Name = "" 'Applies Slide Number Style to Entire List
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
True, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
wdWord10ListBehavior
End Sub


Sub ChangeListFormat()
'

snb
03-16-2014, 01:34 PM
You don't need any VBA.

Writeforaliv
03-18-2014, 04:52 PM
Again, thank you for taking the time to work on this.

I think I do need VBA or at least a list style that will automatically separate text from the list. I work with Adobe Captivate to generate a list of caption text in a Word document. Because I'm not creating the list from scratch, but only organizing it, I'd like any easier way to have the text appear under each Slide Number heading. Do you have another suggestion?

snb
03-19-2014, 04:13 AM
See the attachment.