, Sleep API .
"" , .
VBA . ( , Timer API, .)
.
PPT (M)
https://drive.google.com/file/d/0ByoPCwQXKo0HVGhZOVJvYkJwak0/view
. . Alt-F11 .
"model" 2. 3, . , , , , , . VBA , .
"", .
"" , .
Option Base 1
Const MAX = 10
Sub Add()
Dim shp As Shape
Dim str() As String
Dim i As Integer
'First, remove sentences that were added before
Remove
' Initialize str() array
ReDim str(MAX)
For i = 1 To MAX
str(i) = "This is the sentence #" & i
Next i
'Let copy the textbox on Slide #2 onto Slide #3
Set shp = ActivePresentation.Slides(2).Shapes("TextBox 1")
shp.Copy
For i = 1 To UBound(str)
With ActivePresentation.Slides(3).Shapes.Paste
.Left = shp.Left
.Top = shp.Top
.TextFrame.TextRange.Text = str(i)
.Name = "TextBox " & i
End With
Next i
'Message
MsgBox "Total " & i - 1 & " sentence(s) has(have) been added."
'go to the Slide #3
SlideShowWindows(1).View.GotoSlide 3
End Sub
Sub Remove()
Dim i As Integer, cnt As Integer
With ActivePresentation.Slides(3)
'When deleting, be sure to delete shapes from the top. Otherwise, some shapes might survive
For i = .Shapes.Count To 1 Step -1
If Left(.Shapes(i).Name, 8) = "TextBox " Then
.Shapes(i).Delete
cnt = cnt + 1
End If
Next i
End With
If cnt > 0 Then MsgBox "Total " & cnt & " sentence(s) has(have) been removed."
End Sub
, , 'str()'