Muokkaa

Jaa


Shapes.AddMediaObject method (PowerPoint)

Important

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

Name Required/Optional Data type Description
FileName Required String Required String. The file from which the media object is to be created. If the path isn't specified, the current working folder is used.
Left Optional Single The position (in points) of the upper-left corner of the media object's bounding box relative to the upper-left corner of the document.
Top Optional Single The position (in points) of the upper-left corner of the media object's bounding box relative to the upper-left corner of the document.
Width Optional Single The width of the media object's bounding box, in points.
Height Optional Single The 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

Shapes Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.