0

I have a VBA Code to resize objects in PowerPoint including Font size, margins and everything else. But I haven’t found a solution to update/change an existing TapStop. There is a the Ruler Object with different levels und a default value. I double checked also the TextRange Object with Characters.

Are there any ideas to update the TabStop size?

Here is an example of a TextBox, i would like to resize:

TextBox Example

Shape.textframe.ruler.tabstops.count is always 0, if I "take" just the shape by For-Each-Loop. If I select it manual, it's also 0 at the sub menu TabStops of Paragraph menu. If I click inside the shape (blinking cursor) and open the TabStops menu again, I see one TabStopPosition.

How can I access this information by VBA?

I tried it already by Line.Selection and nothing works.

Thanks!

Moe

Moe
  • 43
  • 5
  • 1
    http://www.pptfaq.com/FAQ00794_Working_with_Tab_settings_in_text.htm – Tim Williams Nov 20 '17 at 07:02
  • @TimWilliams thank you for your answer. I tried the VBA code from your link, but it did found any TabStop. For this reason I added an example screenshot. Any ideas? – Moe Nov 20 '17 at 08:12
  • I have the situation. If I just select the shape, I don't see any TabStopPositions at Settings and shp.textframe.ruler.tabstops.count is 0. If I click inside the shape in the first line, I see one TabStopPositions in the first line. If I set TabStopPositions for the whole Shape the counters (shp.textframe.ruler.tabstops.count) changes to 1. And then I can change the size with: shp.textframe.ruler.tabstops.item(1).position – Moe Nov 20 '17 at 10:53

1 Answers1

2

PowerPoint used to allow only one set of paragraph settings per textframe (ie, per shape). That changed in PPT2007; now each paragraph can have its own tab and other settings. Have a go with this:

Sub ShowMeTabs()

Dim X As Long
Dim lTabCount As Long

    With ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange
        For X = 1 To .Paragraphs.Count
            Debug.Print X
            With .Paragraphs(X).ParagraphFormat
                For lTabCount = 1 To .TabStops.Count
                    Debug.Print .TabStops(lTabCount).Position
                Next    ' Tab
                Debug.Print "Level:" & .IndentLevel & " Position:" & .LeftIndent 'etc

            End With
        Next    ' paragraph x
    End With

End Sub
Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34
  • Awesome! Thank you for your help! .LeftIndent is always 0. But I just need .Position to scale it up or down. – Moe Nov 20 '17 at 16:07