1

我有很多幻灯片,每张幻灯片都有很多线条,但所有这些线条都在同一个对象中。我现在想添加一些动画,包括通过点击为每一行出现。

我如何划分每张幻灯片中的线条,以便每条线都在自己的对象中

注意,我使用的是 powerpoint 2010

谢谢,

AA

4

1 回答 1

-1

这并不完美。您需要添加更多代码才能从原始文本中提取所有格式,但这是一个开始。在要修改的文本框中单击,然后运行 ​​TEST 子程序。一旦它适应了你的口味,扩展它以作用于整个演示文稿中的每个文本框是一件相当简单的事情(尽管不是表格、图表、smartart 之类的东西)

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
于 2012-11-17T17:41:15.027 回答