将powerpoint线分成不同的对象

时间:2012-11-17 16:43:46

标签: powerpoint

我有很多power point幻灯片,每张幻灯片都有很多行,但所有这些行都在同一个对象中。我现在想要添加一些动画,包括单击每行显示的动画。

如何对每张幻灯片中的行进行分区,使每一行都在自己的对象中

注意,我使用的是powerpoint 2010

谢谢,

AA

1 个答案:

答案 0 :(得分:-1)

这并不完美;你需要添加更多的代码来从原始文本中获取所有格式,但这是一个开始。在要修改的文本框中单击,然后运行TEST子。一旦它根据您的喜好进行调整,将它扩展为在整个演示文稿中的每个文本框上进行操作都是相当简单的事情(尽管不是表格,图表,智能设备,类似的东西)

Sub Test()
    TextBoxToLines ActiveWindow.Selection.ShapeRange(1)
End Sub


Sub TextBoxToLines(oSh As Shape)

    Dim oSl As Slide
    Dim oNewShape As Shape
    Dim oRng As TextRange
    Dim x As Long

    With oSh
    Set oSl = .Parent
    With .TextFrame.TextRange
        For x = 1 To .Paragraphs.Count
            Set oRng = .Paragraphs(x)
            Set oNewShape = oSl.Shapes.AddTextbox(msoTextOrientationHorizontal, _
                oRng.BoundLeft, oRng.BoundTop, oRng.BoundWidth, oRng.BoundHeight)
            With oNewShape
                .TextFrame.AutoSize = ppAutoSizeNone
                .Left = oRng.BoundLeft
                .Top = oRng.BoundTop
                .Width = oSh.Width
                .Height = oSh.Height
                With .TextFrame.TextRange
                    .Text = oRng.Text
                    .Font.Name = oRng.Font.Name
                    .Font.Size = oRng.Font.Size
                    ' etc ... pick up any other font formatting you need
                    ' from oRng, which represents the current paragraph of
                    ' the original text
                    ' Bullets, tabs, etc.
                End With
            End With
        Next
    End With
    End With

    oSh.Delete

End Sub