Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word document bulleted list format

Status
Not open for further replies.

simian336

Programmer
Sep 16, 2009
723
US
I have been pulling my hair out so I might as well ask... I found some code below to create a bulleted list. On my machine the bullet is a black dot. My user wants to change the code so the bullet is a blue squeare.

Any idea what I need to change?

Thanks

Simi



.ListGalleries(wdBulletGallery).ListTemplates(1).Name = ""
.Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=.ListGalleries(wdBulletGallery).ListTemplates(1), _
ContinuePreviousList:=False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:=wdWord9ListBehavior



With .Selection
.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Font.Bold = False
.Font.Size = 12
.TypeText ("some details1")
.TypeParagraph
.TypeText ("some details2")
.TypeParagraph
End With
 
The correct way to do this is to define a paragraph Style with the desired formatting (preferably in the document's template if it's required for multiple documents), then simply apply that Style whenever it's required. So much simpler and easier to maintain...

Cheers
Paul Edstein
[MS MVP - Word]
 
After lots of playing I think I finally figured it out. You have to define the bulleted list a template. Then turn it on add your text then turn it off.

Simi


' Define the bulleted List Style

With ListGalleries(wdBulletGallery).ListTemplates(1).ListLevels(1)
.NumberFormat = ChrW(61607)
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleBullet
.NumberPosition = InchesToPoints(0.25)
.Alignment = wdListLevelAlignLeft
.TextPosition = InchesToPoints(0.5)
.TabPosition = wdUndefined
.ResetOnHigher = 0
.StartAt = 1
With .Font
.Bold = wdUndefined
.Italic = wdUndefined
.Strikethrough = wdUndefined
.Subscript = wdUndefined
.Superscript = wdUndefined
.Shadow = wdUndefined
.Outline = wdUndefined
.Emboss = wdUndefined
.Engrave = wdUndefined
.AllCaps = wdUndefined
.Hidden = wdUndefined
.Underline = wdUndefined
.Color = -738131969
.Size = wdUndefined
.Animation = wdUndefined
.DoubleStrikeThrough = wdUndefined
.Name = "Wingdings"
End With
.LinkedStyle = ""
End With

'Trun on the style...
ListGalleries(wdBulletGallery).ListTemplates(1).Name = ""
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
ListGalleries(wdBulletGallery).ListTemplates(1), ContinuePreviousList:= _
False, ApplyTo:=wdListApplyToSelection, DefaultListBehavior:= _
wdWord10ListBehavior

With Selection
.TypeText "bla1"
.TypeParagraph
End With

With Selection
.TypeText "bla2"
.TypeParagraph
End With

With Selection
.TypeText "bla3"
.TypeParagraph
End With

'Turn off the bulleted list
With Selection
.Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top