HI,

Please help me in colourin the text frame with 2 different colours.

With ppSlide1.Shapes(3)
.TextFrame.TextRange.Text = "Wing PRR :Total Weight: "
.TextFrame.TextRange.Font.Bold = True
.TextFrame.TextRange.Font.Color = vbWhite
.TextFrame.TextRange.Font.Size = 26
.TextFrame.TextRange.Font.Name = "Arial"
End With

"Wing PRR:" - in White colour
"Total Weight" - Yellow colour

Regards,
Dinil

Private Sub CommandButton1_Click()
    With ppSlide1.Shapes(3)
        'Each space is termination for a word.
        .TextFrame.TextRange.Text = "Wing PRR : Total Weight : "

        .TextFrame.TextRange.Words(1, 3).Font.Bold = msoCTrue
        .TextFrame.TextRange.Words(4, 3).Font.Bold = msoCTrue

        .TextFrame.TextRange.Words(1, 3).Font.Color = vbRed
        .TextFrame.TextRange.Words(4, 3).Font.Color = vbGreen

        .TextFrame.TextRange.Words(1, 3).Font.Size = 26
        .TextFrame.TextRange.Words(4, 3).Font.Size = 30

        .TextFrame.TextRange.Words(1, 3).Font.Name = "Tahoma"
        .TextFrame.TextRange.Words(4, 3).Font.Name = "Times New Roman"
    End With
End Sub

Hi,

Try This Code:

With ppSlide1.Shapes(3)
.TextFrame.TextRange.Text = "Wing PRR :Total Weight: "
.TextFrame.TextRange.Characters(Start:=1, Length:=9).Font.Color.RGB = RGB(255, 0, 0)
.TextFrame.TextRange.Characters(Start:=10, Length:=12).Font.Color.RGB = RGB(0, 0, 255)

.TextFrame.TextRange.Font.Bold = True
.TextFrame.TextRange.Font.Color = vbWhite
.TextFrame.TextRange.Font.Size = 26
.TextFrame.TextRange.Font.Name = "Arial"
End With

Change RGB Accordingly..

Regards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.