TextFrame object in powerpoint 2013, different fonts from VBA

I've got a TextFrame object in a powerpoint slide.  I'd like to manipulate the object through VBA but it has different font sizes in the text.
SNAG-0010.bmpHow can I select a piece of text and apply a different font to it using VBA code?
LVL 46
AndyAinscowFreelance programmer / ConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
Hi,
pls try

Sub macro()

Set s = ActiveWindow.Selection
Set chars = s.ShapeRange.TextFrame.TextRange.Characters
For Each char In chars
    If char.Start <= 5 Then
        char.Font.Size = 22
    Else
        char.Font.Size = 35
    End If
Next
End Sub
'Or

Sub macro1()

Set s = ActiveWindow.Selection
s.ShapeRange.TextFrame.TextRange.Font.Size = 35
s.ShapeRange.TextFrame.TextRange.Characters(1, 5).Font.Size = 22
End Sub

Open in new window

Regards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndyAinscowFreelance programmer / ConsultantAuthor Commented:
The second works, I've not tried the first.
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft PowerPoint

From novice to tech pro — start learning today.