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

Shapes.AddMediaObject2 Method (PowerPoint)

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

Replaces deprecated Shapes.AddMediaObject Method (PowerPoint). Adds a new media object.

Syntax

expression. AddMediaObject2( FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height )

expression A variable that represents a Shapes object.

Parameters

NameRequired/OptionalData TypeDescription
FileNameRequiredStringThe name of the file to be added.
LinkToFileOptional[MSOTRISTATE]Indicates whether to link to the file.
SaveWithDocumentOptional[MSOTRISTATE]Indicates whether to save the media with the document.
LeftOptionalSingleThe distance, in points, from the left edge of the slide to the left edge of the media object.
TopOptionalSingleThe distance, in points, from the top edge of the slide to the top edge of the media object.
WidthOptionalSingleThe width, in points, of the media object. Default value is -1.
HeightOptionalSingleThe height, in points, of the media object. Default value is -1.

Return Value

Shape object

Remarks

The default value varies depending whether the new media is an audio or video file, and on file size. If both LinkToFile and SaveWithDocument are False, this method returns an error. At least one must be True. Note that the object model allows an object to be both linked and embedded, which is not allowed through the user interface (UI).

See also

Concepts

Shapes Object

© 2018 Microsoft