Table of contents
TOC
Collapse the table of content
Expand the table of content

Shapes.AddMediaObject Method (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Deprecated in PowerPoint 2013. See Shapes.AddMediaObject2 Method (PowerPoint). Creates a media object. Returns a Shape object that represents the new media object.

Syntax

expression. AddMediaObject( FileName, Left, Top, Width, Height )

expression A variable that represents a Shapes object.

Parameters

NameRequired/OptionalData TypeDescription
FileNameRequiredStringRequired String. The file from which the media object is to be created. If the path isn't specified, the current working folder is used.
LeftOptionalSingleThe position (in points) of the upper-left corner of the media object's bounding box relative to the upper-left corner of the document.
TopOptionalSingleThe position (in points) of the upper-left corner of the media object's bounding box relative to the upper-left corner of the document.
WidthOptionalSingleThe width of the media object's bounding box, in points.
HeightOptionalSingleThe height of the media object's bounding box, in points.

Return Value

Shape

Example

This example adds the movie named "Clock.avi" to myDocument.

Set myDocument = ActivePresentation.Slides(1)

myDocument.Shapes.AddMediaObject FileName:="C:\Windows\clock.avi", _
    Left:=5, Top:=5, Width:=100, Height:=100

See also

Concepts

Shapes Object

© 2018 Microsoft