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.