object, we put to gether some text with the user’s name, just like we did with a
MsgBox
in our earlier
DoingWell
pro ce dures.
Of course, you can do the same thing with a shape
that you use VBA to cre-
ate, but you can fig ure that out for yourself.
Ma nip u lat ing Text in Ob jects
In the previous section, we changed the text in a shape by accessing the
shape’s
.TextFrame.TextRange.Text
. Now
that you have access to that
part of a shape, you can do whatever you want to the text in that shape. This is
useful for chang ing the text in shapes you draw with the drawing tools, in shapes
you
cre ate with VBA with
AddShape
, and in shapes that come with PowerPoint
slides (such as the title or bulleted text area on a slide). But you can do more than
simply change the text on a shape to something new. You can ma nipulate the
text in many different ways. This section doesn’t
cover all of them, but it is
enough to get you started exploring.
With
Blocks
Before changing the text, we should learn a simple VBA trick to save you
from typ ing long ex pressions over and over again. You might have no ticed that
to
get to the text for a shape, you have to type something very long, such as
Do'stlaringiz bilan baham: