.Shapes("Rect
angle 3")
.TextFrame.TextRange.Text = _
.TextFrame.TextRange.Text & Chr$(13) & "Hello Mother"
End With
End Sub
The
With
line (including the next line that is really part of that line due to the un -
derscore) tells the computer that we are go ing to do something with the shape
named “Rectangle 3” on the current slide. If the current slide is a Bulleted List
slide, “Rect angle 3” re fers to the bulleted list area (the main area for text).
.TextFrame.TextRange.Text_=__'>.TextFrame.TextRange.Text = _
tells the com puter that we are go ing to put something into the text area of that
slide. Af ter the equal sign, the next line
.TextFrame.TextRange.Text & Chr$(13) & "Hello Mother"
tells the com puter what we are go ing to put into the text area. We are go ing to
• start with what is already there (
.TextFrame.TextRange.Text
);
• add to that a spe cial character,
Chr$(13)
, which is the New Para -
graph symbol (just like hit ting “Enter” or “Return” if you were typ -
ing the text into the text area your self); and
• add the text “Hello Mother”.
This will have the ef fect of taking what was already in the bulleted list and add -
ing a new line with the words “Hello Mother.” Remember, you can do any thing
with the text that you want. We added “Hello Mother” as a simple example. You
could have added the user’s name. For example, you might write an in teractive
story with your students in which the student types a name at the beginning of
the story, and the name is used dur ing the story by replacing or modifying the
text in one of the slides:
80 A Scripting Bag of Tricks
Sub BrickPig()
With ActivePresentation.Slides(7).Shapes("Rect
Do'stlaringiz bilan baham: |