Change colour of bullet point and make text bold/italics

Rabea nopes 0 Reputation points
2023-05-16T09:33:18.7833333+00:00

Dear person,

I wrote some VBA code to automate powerpoint slides per row of my excel file.

Everything works great so far, only thing is that I would like to change the colour of the bullett point that is created with the Placeholder(2) line. Also how can I make it so that some of the DataRow.Cells are printed bold/italics?

I have tried looking online but the code seems so different, I have no idea how to make us of it.

Code:

Option Explicit

'reference to PPTX via een sub routine
Sub Powerpointmkn()

    Dim DataRange As Range
    Dim DataRow As Range
    Dim ppt As PowerPoint.Application
    Dim Presentation As PowerPoint.Presentation
    Dim Slide As PowerPoint.Slide
    
  
    Set ppt = New PowerPoint.Application
 
    Set Presentation = ppt.Presentations.Add
    
    ppt.Visible = True
    

    Set DataRange = Range("A1:H23")
    
    For Each DataRow In DataRange.Rows
       Set Slide = Presentation.Slides.AddSlide(Presentation.Slides.Count + 1, Presentation.SlideMaster.CustomLayouts(2))
       Slide.Shapes.Title.TextFrame.TextRange.Text = DataRow.Cells(1, 8) & " " & DataRow.Cells(1, 1) & " " & DataRow.Cells(1, 2)
       Slide.Shapes.Placeholders(2).TextFrame.TextRange.Text = DataRow.Cells(1, 7) & " " & DataRow.Cells(1, 5) & " " & DataRow.Cells(1, 3) & " " & DataRow.Cells(1, 4)
    Next DataRow
End Sub
Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | PowerPoint | For business | Windows
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.