This looks complicated, but it is not as complicated as it looks.
This procedure
does three things: It cre ates the rectangle,
it turns it red, and it puts the word
“Hello” in side. Let’s take it line by line:
Dim myShape As Shape
We are going to cre ate a shape, so we create a variable to hold that shape. That
way,
once the shape is cre ated, we can re fer to it later in the procedure. Next we
create the shape:
Set myShape = _
ActivePresentation.SlideShowWindow.View.Slide.Shapes. _
AddShape(Type:=msoShapeRectangle, Left:=100, Top:=100, _
Width:=200, Height:=200)
ActivePresentation.SlideShowWindow.View.Slide
gives us the
cur rent slide.
Shapes
gives us
the shapes on the slide, and the
AddShape
method is used to add a shape to the shapes on the slide. Now, ev erything be -
tween the pa rentheses is simply telling you about the shape:
• The
Type
is what shape you are cre ating:
msoShapeRectangle
for
a rect an gle.
•
Left
and
Top
are the lo cation on the screen
of the top left corner of
the shape
•
Width
and
Height
are how wide and tall the shape is.
Some other shapes you might use in stead of
msoShapeRectangle
are:
msoShape4pointStar
Do'stlaringiz bilan baham: