Shapes.Add3DModel method (PowerPoint)

Creates a Model3DFormat object from an existing file. Returns a Shape object that represents the new 3D model.

Syntax

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

expression A variable that represents a Shapes object.

Parameters

Name Required/Optional Data type Description
FileName Required String The file from which the 3D model object is to be created.
LinkToFile Required MsoTriState Determines whether the 3D model will be linked to the file from which it was created.
SaveWithDocument Required MsoTriState Determines whether the linked 3D model will be saved with the document into which it is inserted. This argument must be msoTrue if LinkToFile is msoFalse.
Left Required Single The position, measured in points, of the left edge of the 3D model relative to the left edge of the slide.
Top Required Single The position, measured in points, of the top edge of the 3D model relative to the top edge of the slide.
Width Optional Single The width of the 3D model, measured in points (enter -1 to auto-calculate a width based on the 3D model dimensions).
Height Optional Single The height of the 3D model, measured in points (enter -1 to auto-calculate a height based on the 3D model dimensions).

Return value

Shape

Example

This example adds a 3D model created from the file Sphere.glb to mySlide. The inserted 3D model is embedded in the active document.

Set mySlide = Application.ActivePresentation.Slides(1) 
Set myShape = mySlide.Shapes.Add3DModel(FileName:="c:\my 3d models\sphere.glb", LinkToFile:=False, SaveWithDocument:=True, Left:=100, Top:=100, Width:=70, Height:=70 )

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.