In the up per left corner of the di alog box, you will see the ob jects listed by
type and num ber. You can see that the text ob ject is shape 1, the rectangle is
shape 2, and the ac tion but ton is shape 3. If you have
lots of ob jects of the same
type, you can click on the type and num ber of an ob ject and the ob ject will be
highlighted on the right.
Once you have figured out the num ber of the ob ject you want, you can close
the di alog box with or without setting any animation.
For PowerPoint 2002, Cus tom Animation does not
list all the ob jects on the
slide, but it will list the ob jects that are an imated. There fore, if you want to find
out an ob ject’s number, click on the ob ject to select it, choose “Custom
Anima-
tion” from the Slide Show menu, and add an animation effect (see Fig ure 6.4).
Just as in earlier ver sions of PowerPoint, the number that ap pears after the ob ject
type is the object’s number.
In this case, the rect angle was se lected, and it is ob-
ject number 2 be cause the an imation list shows “Rect angle 2.” Note that the
number 1 on the slide and in the an imation list re fers to
the animation or der, not
the ob ject num ber. After determining the ob ject’s number, don’t for get to re-
move the an imation effect by clicking on the “Remove” button in the “Custom
Animation” window.
Figure 6.4. Find ing the Ob ject Num ber in PowerPoint 2002
72 A Scripting Bag of Tricks
The difficulty with referencing ob jects by number is that numbers change.
This can hap pen if you delete an ob ject from your slide or change the drawing
order of your ob jects (by go ing to the Draw menu
and choosing something from
the Order submenu). When you delete an ob ject from a slide, all the higher num-
bered ob jects change. For ex ample, in our slide
above with the text ob ject, the
rectangle, and the button, if we delete the text object, the rect angle becomes ob-
ject num ber 1, and the but ton be comes ob ject num ber 2.
If you had written a
script to do something to the rectangle, referencing the rectangle as ob ject 2,
your script would not work. That is why it is better to reference ob jects by name;
names do not change unless you change them.
Do'stlaringiz bilan baham: