StarPig
12-30-2018, 05:56 AM
Hello John. From a closed thread I took the below code, but I fail to make it work for selected text in tables (I renamed the Sub). For example, it works fine in text boxes, for selected (highlighted) text. I would be nice to have this feature work in tables. Happy New Year
Sub TableBullets()
With Application.ActiveWindow.Selection
If .Type = ppSelectionText Then
I = 1
For I = 1 To .TextRange.Paragraphs.Count
With .TextRange.Paragraphs(Start:=I, Length:=1)
Select Case .IndentLevel
Case Is = 1
.ParagraphFormat.Alignment = ppAlignLeft
.Parent.Ruler.Levels(I).FirstMargin = 0
.Parent.Ruler.Levels(I).LeftMargin = 15
With .ParagraphFormat.Bullet
.visible = msoCTrue
With .Font
.Name = "Wingdings"
.Color.RGB = RGB(0, 0, 0)
End With
.Character = 167
End With
Case Is = 2
.ParagraphFormat.Alignment = ppAlignLeft
.Parent.Ruler.Levels(I).FirstMargin = 16
.Parent.Ruler.Levels(I).LeftMargin = 31
With .ParagraphFormat.Bullet
.visible = msoCTrue
With .Font
.Name = "Arial"
.Color.RGB = RGB(0, 0, 0)
End With
.Character = 8211
End With
Case Is = 3
.ParagraphFormat.Alignment = ppAlignLeft
.Parent.Ruler.Levels(I).FirstMargin = 32
.Parent.Ruler.Levels(I).LeftMargin = 47
With .ParagraphFormat.Bullet
.visible = msoCTrue
With .Font
.Name = "Wingdings"
.Color.RGB = RGB(0, 0, 0)
End With
.Character = 167
.RelativeSize = 0.9
End With
End Select
End With
Next I
End If
End With
End Sub
Sub TableBullets()
With Application.ActiveWindow.Selection
If .Type = ppSelectionText Then
I = 1
For I = 1 To .TextRange.Paragraphs.Count
With .TextRange.Paragraphs(Start:=I, Length:=1)
Select Case .IndentLevel
Case Is = 1
.ParagraphFormat.Alignment = ppAlignLeft
.Parent.Ruler.Levels(I).FirstMargin = 0
.Parent.Ruler.Levels(I).LeftMargin = 15
With .ParagraphFormat.Bullet
.visible = msoCTrue
With .Font
.Name = "Wingdings"
.Color.RGB = RGB(0, 0, 0)
End With
.Character = 167
End With
Case Is = 2
.ParagraphFormat.Alignment = ppAlignLeft
.Parent.Ruler.Levels(I).FirstMargin = 16
.Parent.Ruler.Levels(I).LeftMargin = 31
With .ParagraphFormat.Bullet
.visible = msoCTrue
With .Font
.Name = "Arial"
.Color.RGB = RGB(0, 0, 0)
End With
.Character = 8211
End With
Case Is = 3
.ParagraphFormat.Alignment = ppAlignLeft
.Parent.Ruler.Levels(I).FirstMargin = 32
.Parent.Ruler.Levels(I).LeftMargin = 47
With .ParagraphFormat.Bullet
.visible = msoCTrue
With .Font
.Name = "Wingdings"
.Color.RGB = RGB(0, 0, 0)
End With
.Character = 167
.RelativeSize = 0.9
End With
End Select
End With
Next I
End If
End With
End Sub