Change bullet colours under VBA

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Change bullet colours under VBA

Post by Robie »

Is it possible to change the colours of the bullets (Level 1 thru to level 5) in a ppt?

That is, I could have a presentation with n pages and now I would like to change the default bullet colours for all pages (the colours is determined by the available six company colours to the user)? This needs to be done as a macro so that the user just has to select the available company colours & it changes the bullets to match the selected colour.
bullet colours.png
Thanks.

Robie
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change bullet colours under VBA

Post by HansV »

See if you can modify this to suit your needs:

Code: Select all

Sub SetBulletColor()
  Dim lngColor As Long
  Dim i As Integer
  ' Set color
  lngColor = vbRed
  For i = 1 To 5
    ActivePresentation.SlideMaster.TextStyles(ppBodyStyle) _
      .Levels(i).ParagraphFormat.Bullet.Font.Color = lngColor
  Next i
End Sub
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Change bullet colours under VBA

Post by Robie »

HansV wrote:See if you can modify this to suit your needs:

Code: Select all

Sub SetBulletColor()
  Dim lngColor As Long
  Dim i As Integer
  ' Set color
  lngColor = vbRed
  For i = 1 To 5
    ActivePresentation.SlideMaster.TextStyles(ppBodyStyle) _
      .Levels(i).ParagraphFormat.Bullet.Font.Color = lngColor
  Next i
End Sub
Hey Hans - you are a STAR man. That works beautifully. :clapping: :fanfare: