Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

Proud member of

PPTools

Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Indents: zeroing them out, resetting them etc.

Problem

Once in a while you need to apply a consistent set of indents to many text boxes, which can be very tedious to do one at a time.

Other times, you may run into corrupted text boxes that have indent levels in all sorts of weird positions.

Solution

The following two macros let you zero out all of the indents in the selected text box or set the indents to any values you like.

Sub AllIndentsToNull()
' Sets ALL indents to 0
' Works only on the currently selected text box
' Be sure to select the text box before running this
' or it'll error out.  Harmlessly.

    Dim oShp As Shape
    Dim x As Long

    Set oShp = ActiveWindow.Selection.ShapeRange(1)
    With oShp
        With .TextFrame.Ruler
            For x = 1 To .Levels.Count
                .Levels(x).FirstMargin = 0
                .Levels(x).LeftMargin = 0
            Next
        End With
    End With

End Sub

Or use this to set each indent level however you like:

Sub SetIndents()
' Sets indents to values you choose below
' Works only on the currently selected text box
' Be sure to select the text box before running this
' or it'll error out.  Harmlessly.

    Dim oShp As Shape
    Dim x As Long

    Set oShp = ActiveWindow.Selection.ShapeRange(1)
    With oShp
        With .TextFrame.Ruler

            ' Change the values for each level
            ' to whatever you like:

            .Levels(1).FirstMargin = 0
            .Levels(1).LeftMargin = 0

            .Levels(2).FirstMargin = 0
            .Levels(3).LeftMargin = 0

            .Levels(3).FirstMargin = 0
            .Levels(3).LeftMargin = 0

            .Levels(4).FirstMargin = 0
            .Levels(4).LeftMargin = 0

            .Levels(5).FirstMargin = 0
            .Levels(5).LeftMargin = 0

        End With
    End With

End Sub

See How do I use VBA code in PowerPoint? to learn how to use this example code.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2022 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Indents: zeroing them out, resetting them etc.
http://www.pptfaq.com/FAQ01039_Indents-_zeroing_them_out-_resetting_them_etc-.htm
Last update 07 June, 2011
Created: