Share via


Item Method

Item Method
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

Item method as it applies to the ActionSettings object.

Returns a single action setting from the specified ActionSettings collection.

expression.Item(Index)

expression   Required. An expression that returns an ActionSettings collection.

PpMouseActivation

PpMouseActivation can be one of these PpMouseActivation constants.
ppMouseClick The action setting for when the user clicks the shape.
ppMouseOver The action setting for when the mouse pointer is positioned over the specified shape.

Item method as it applies to the AddIns, CanvasShapes, Designs, DiagramNodeChildren, DiagramNodes, Fonts, GroupShapes, NamedSlideShows, Presentations, ShapeNodes, ShapeRange, Shapes, SlideRange, and Slides objects.

Returns a single object from the specified collection.

expression.Item(Index)

expression   Required. An expression that returns one of the above objects.

Index  Required Variant. The name or index number of the single object in the collection to be returned.

Returns a single object from the specified collection.

expression.Item(Index)

expression   Required. An expression that returns an AnimationBehaviors collection.

Index  Required Long. The index number of the single object in the collection to be returned.

Item method as it applies to the Borders object.

Returns a LineFormat object for the specified border.

expression.Item(BorderType)

expression   Required. An expression that returns a Borders collection.

PpBorderType

PpBorderType can be one of these PpBorderType constants.
ppBorderBottom
ppBorderDiagonalDown
ppBorderDiagonalUp
ppBorderLeft
ppBorderRight
ppBorderTop

Item method as it applies to the Tags object.

Returns a single tag from the specified Tags collection.

expression.Item(Name)

expression   Required. An expression that returns a Tags object.

Name  Required String. The name of the single tag in the collection to be returned.

Item method as it applies to the TextStyles object.

Returns a single text style from the specified **TextStyles**collection.

expression.Item(Type)

expression   Required. An expression that returns a TextStyles collection.

PpTextStyleType

PpTextStyleType can be one of these PpTextStyleType constants.
ppBodyStyle
ppDefaultStyle
ppTitleStyle

Remarks

The Item method is the default member for a collection. For example, the following two lines of code are equivalent:

  ActivePresentation.Slides.Item(1)
ActivePresentation.Slides(1)

For more information about returning a single member of a collection, see Returning an Object from a Collection.

Example

As it applies to the ActionSettings object.

This example sets shape three on slide one to play the sound of applause and uses the AnimateAction property to specify that the shape's color is to be momentarily inverted when the shape is clicked during a slide show.

  With ActivePresentation.Slides.Item(1).Shapes _
        .Item(3).ActionSettings.Item(ppMouseClick)
    .SoundEffect.Name = "applause"
    .AnimateAction = True
End With

As it applies to the RulerLevels object. 

This example sets the first-line indent and the hanging indent for outline level one in body text on the slide master for the active presentation.

  With ActivePresentation.SlideMaster.TextStyles.Item(ppBodyStyle)
    With .Ruler.Levels.Item(1) ' sets indents for level 1
        .FirstMargin = 9
        .LeftMargin = 54
    End With
End With

As it applies to the Shapes object. 

This example sets the foreground color to red for the shape named "Rectangle 1" on slide one in the active presentation.

  ActivePresentation.Slides.Item(1).Shapes.Item("rectangle 1").Fill _
    .ForeColor.RGB = RGB(128, 0, 0)

As it applies to the Tags object. 

This example hides all slides in the active presentation that don't have the value "east" for the "region" tag.

  For Each s In ActivePresentation.Slides
    If s.Tags.Item("region") <> "east" Then
        s.SlideShowTransition.Hidden = True
    End If
Next