Home>

In PowerPoint, I want to realize the operation equivalent to the "Clear all formats" command with macros over all slides.
More specifically, I would like to reset only the "font" information in the "format" so that it can be unified with the specified font of the slide master. (Leave color and bold information)
Instead of specifying the font completely, I want it to be converted flexibly for each slide master.

* In many cases, the "Replace font" command, unification with the slide master, and changing the font of "Design" do not work well.
* In the above, there is also a problem that some Calibri alphabet fonts become Mandel.

Corresponding source code

I'm using macros (VBA) in Powerpoint 2016 for Mac

What I tried It's a code, but I have to specify the font name and I don't know how to reset it.
It is possible to run for the time being.

Sub Change fonts at once ()
Dim sld As Slide
Dim shp As Shape
For Each sld In Active Presentation.Slides
For Each shp In sld.Shapes
With shp
If .HasTextFrame Then
With .TextFrame.TextRange.Font
.Name = "Calibri"
.NameFarEast = "Meiryo"
End With
End If
End With
Next shp
Next sld
End Sub
  • Answer # 1

    With .TextFrame.TextRange.Font
    .Name = ActivePresentation.SlideMaster.TextStyles.Item (Type: = ppDefaultStyle) .Levels (Level: = 1) .Font.NameAscii
    .NameFarEast = ActivePresentation.SlideMaster.TextStyles.Item (Type: = ppDefaultStyle) .Levels (Level: = 1) .Font.NameFarEast
    End With
    Solved with