Autofit context to box

 

  1. Open the PowerPoint.
  2. Go to Tools → Macro → Visual Basic Editor.
    If you have the Developer tab, you can also use Developer → Visual Basic.
  3. Choose Insert → Module.
  4. Paste this:

Sub ShrinkTextOnOverflow_AllSlides()


    Dim sld As Slide

    Dim shp As Shape


    For Each sld In ActivePresentation.Slides

        For Each shp In sld.Shapes

            SetShrinkToFit shp

        Next shp

    Next sld


    MsgBox "All text boxes are now set to Shrink Text on Overflow."


End Sub



Sub SetShrinkToFit(ByVal shp As Shape)


    Dim i As Long

    Dim r As Long

    Dim c As Long


    On Error Resume Next


    ' Handle grouped objects

    If shp.Type = msoGroup Then

        For i = 1 To shp.GroupItems.Count

            SetShrinkToFit shp.GroupItems(i)

        Next i


    ' Handle tables

    ElseIf shp.HasTable Then

        For r = 1 To shp.Table.Rows.Count

            For c = 1 To shp.Table.Columns.Count

                With shp.Table.Cell(r, c).Shape.TextFrame2

                    .WordWrap = msoTrue

                    .AutoSize = msoAutoSizeTextToFitShape

                End With

            Next c

        Next r


    ' Handle regular text boxes and placeholders

    ElseIf shp.HasTextFrame Then

        With shp.TextFrame2

            .WordWrap = msoTrue

            .AutoSize = msoAutoSizeTextToFitShape

        End With

    End If


    On Error GoTo 0


End Sub



Then close the Visual Basic window and go to Tools → Macro → Macros, select , and click Run.

No comments

HCCA ENGLISH 8 — MASTER LESSON-PLANNING CONTEXT

  1. Teaching context I teach English 8 at HCCA, an online charter school. I have roughly 300 students. Some classes contain both 8th- and 9...