I would like to create a macro on powerpoint, when I highlight a portion of the text and run the macro. it will create a level1 round bullet. I intend to use this as the base to create level 2 (sub-bullets, nested within level 1), and level 3, but couldn't figure out what's wrong with my code. Is there any expert here able to provide me some direction please ?
What I want to achieve is something like this, where eventually I will have 3 button as addin, and level 1 to level 3 bullet style can be switched freely by clicking on the button.
- Level 1 text
- Level 2 text
- Level 2 text
- Level 3 text
- Level 3 text
- Level 2 text
Sub ApplyLBulletsToSelectedCode()
On Error Resume Next
Err.Clear
Dim oText As TextRange
Set oText = ActiveWindow.Selection.TextRange
If Err.Number <> 0 Then
MsgBox "No text was selected. Please highlight some text " _
& "or select a text frame and run the macro again.", vbExclamation
End
End If
With oText
.ParagraphFormat.Alignment = ppAlignLeft
.IndentLevel = 1
With .Parent.Ruler
.Levels(1).FirstMargin = 20
.Levels(1).LeftMargin = 0
End With
With .ParagraphFormat.Bullet
.Visible = msoCTrue
.RelativeSize = 1
.Character = 159
With .Font
.Color.RGB = RGB(0, 0, 0)
.Name = "Wingdings"
End With
End With
With .Font
.Name = "Calibri"
.Bold = msoFalse
.Color.RGB = RGB(0, 0, 0)
.Size = 14
End With
End With
End Sub