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

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.

Prep4PDF preserves interactivity in PowerPoint presentations when you convert to PDF

Working with Tab settings in text

Problem

You have a common set of tab stops that you'd like to apply to multiple text boxes.
Adding the tab stops manually to each text box is VERY tedious.
And that's being kind.

Solution

Select a text box that has the tab stops you want already set.
Run the GetTabStops macro below to memorize the tab settings.
Then select another text box and run SetTabStops to apply the memorized tab settings.
Then another. Click. And another. Click. This is fun! Click. And more ... Click click clickclickclick....

Option Explicit
Public atabs() As String

Sub GetTabStops()
' Select the text whose tab stops you want to pick up then run this macro

    Dim x As Long
    With ActiveWindow.Selection.ShapeRange(1)
        With .TextFrame.Ruler
            Debug.Print .TabStops.Count
            If .TabStops.Count > 0 Then
               ReDim atabs(2, 1 To .TabStops.Count) As String
               For x = 1 To .TabStops.Count
                   Debug.Print .TabStops(x).Position & vbTab & .TabStops(x).Type
                   atabs(1, x) = CStr(.TabStops(x).Position)
                   atabs(2, x) = CStr(.TabStops(x).Type)
               Next
            End If
        End With
    End With

End Sub

Sub SetTabStops()
' Run this macro to apply the memorized tab stops to the selected text

    Dim x As Long
    With ActiveWindow.Selection.ShapeRange(1)
        With .TextFrame.Ruler
            For x = 1 To .TabStops.Count
                .TabStops(x).Clear
            Next
            For x = 1 To UBound(atabs, 2)
                .TabStops.Add Type:=CLng(atabs(2, x)), Position:=CDbl(atabs(1, x))
            Next
        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 - 2015 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.
Español    Deutsch    Français    Português    Italiano    Nederlands    Greek    Japanese    Korean    Chinese

Supercharge your PPT Productivity with PPTools

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

Working with Tab settings in text
http://www.pptfaq.com/FAQ00794_Working_with_Tab_settings_in_text.htm
Last update 07 June, 2011
Created: