rwc1023
07-14-2021, 07:02 AM
Hello - i hope someone can help me to update the codes below to do the resize correctly. I am trying to resize the font of any header and then the body/content as well as on the1st slide. based on my codes below, whenever the size of the font changes in the deck, the codes don't work correctly. Basically i need three separate VBA to do the work. see my codes below. hoping an expert can help!! thank you so much!!: pray2:
1. Change Header font size on every slide to 44
Sub ChangeHeaderFontSize()
Dim sld As Slide
Dim shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame = True Then
If shp.TextFrame.HasText = True Then
If shp.TextFrame.TextRange.Font.Size = 24 Then
shp.TextFrame.TextRange.Font.Size = 44
End If
End If
End If
Next
Next
End Sub
2. Change content font size of every slide to 32
Sub ChangeContentFontSize()
Dim sld As Slide
Dim shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame = True Then
If shp.TextFrame.HasText = True Then
If shp.TextFrame.TextRange.Font.Size = 15 Then
shp.TextFrame.TextRange.Font.Size = 32
End If
End If
End If
Next
Next
End Sub
3. Change header font size to 60 just on 1st Slide
Sub Change1stSlideHeaderFontSize()
Application.ActivePresentation.Slides(1) _
.Shapes(1).TextFrame.TextRange.Font _
.Size = 60
End Sub
1. Change Header font size on every slide to 44
Sub ChangeHeaderFontSize()
Dim sld As Slide
Dim shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame = True Then
If shp.TextFrame.HasText = True Then
If shp.TextFrame.TextRange.Font.Size = 24 Then
shp.TextFrame.TextRange.Font.Size = 44
End If
End If
End If
Next
Next
End Sub
2. Change content font size of every slide to 32
Sub ChangeContentFontSize()
Dim sld As Slide
Dim shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame = True Then
If shp.TextFrame.HasText = True Then
If shp.TextFrame.TextRange.Font.Size = 15 Then
shp.TextFrame.TextRange.Font.Size = 32
End If
End If
End If
Next
Next
End Sub
3. Change header font size to 60 just on 1st Slide
Sub Change1stSlideHeaderFontSize()
Application.ActivePresentation.Slides(1) _
.Shapes(1).TextFrame.TextRange.Font _
.Size = 60
End Sub