Class Shape (PowerPoint VBA)
The class Shape represents an object in the drawing layer, such as an AutoShape, freeform, OLE object, or picture.
To use a Shape class variable it first needs to be instantiated, for example
Dim shp as Shape Set shp = Dim lngX As Long: lngX = Dim lngY As Long: lngY = ActiveWindow.RangeFromPoint(X:=lngX, Y:=lngY)
The following procedures can be used to set variables of type Shape: Cell.Shape, ConnectorFormat.BeginConnectedShape, ConnectorFormat.EndConnectedShape, DocumentWindow.RangeFromPoint, Effect.Shape, FreeformBuilder.ConvertToShape, GroupShapes.Item, Placeholders.FindByName, Placeholders.Item, Presentation.DefaultShape, ResampleMediaTask.Shape, ParentGroup, ShapeRange.Group, ShapeRange.Item ...ShapeRange.ParentGroup, ShapeRange.Regroup, Shapes.Add3DModel, Shapes.AddCallout, Shapes.AddChart2, Shapes.AddConnector, Shapes.AddCurve, Shapes.AddInkShapeFromXML, Shapes.AddLabel, Shapes.AddLine, Shapes.AddMediaObject2, Shapes.AddMediaObjectFromEmbedTag, Shapes.AddOLEObject, Shapes.AddPicture, Shapes.AddPicture2, Shapes.AddPlaceholder, Shapes.AddPolyline, Shapes.AddShape, Shapes.AddSmartArt, Shapes.AddTable, Shapes.AddTextbox, Shapes.AddTextEffect, Shapes.AddTitle, Shapes.Item, Shapes.Title, Timing.TriggerShape.
Apply - expression.Apply
ApplyAnimation - Applies the last picked up animation to the Shape object.
ConvertTextToSmartArt - Converts text in a Shape object to a SmartArt diagram.
Copy - Copies the specified object to the Clipboard.
Cut - Deletes the specified object and places it on the Clipboard.
Delete - Deletes the specified Shape object.
Duplicate - Creates a duplicate of the specified Shape object, adds the new shape to the Shapes collection, and then returns a new ShapeRange object. The duplicated objects are placed at the end of the Shapes collection.
Flip - Flips the specified shape around its horizontal or vertical axis.
IncrementLeft - Moves the specified shape horizontally by the specified number of points.
IncrementRotation - Changes the rotation of the specified shape around the z-axis by the specified number of degrees. Use the Rotation property to set the absolute rotation of the shape.
IncrementTop - Moves the specified shape vertically by the specified number of points.
PickUp - Copies the formatting of the specified shape. Use the Apply method to apply the copied formatting to another shape.
PickupAnimation - Picks up all animation from the Shape object.
RerouteConnections - Reroutes connectors so that they take the shortest possible path between the shapes they connect. To do this, the RerouteConnections method may detach the ends of a connector and reattach them to different connecting sites on the connected shapes.
ScaleHeight - Scales the height of the shape by a specified factor.
ScaleWidth - Scales the width of the shape by a specified factor. For pictures and OLE objects, you can indicate whether you want to scale the shape relative to the original size or relative to the current size. Shapes other than pictures and OLE objects are always scaled relative to their current width.
Select - Selects the specified object.
Ungroup - Ungroups any grouped shapes in the specified shape or range of shapes. Disassembles pictures and OLE objects within the specified shape or range of shapes. Returns the ungrouped shapes as a single ShapeRange object.
UpgradeMedia - Converts a legacy media object to an updated media object.
ZOrder - Moves the specified shape in front of or behind other shapes in the collection (that is, changes the shape's position in the z-order).
Adjustments returns an Adjustments object that contains adjustment values for all the adjustments in the specified shape. Applies to any Shape object that represents an AutoShape, WordArt, or a connector.
AlternativeText returns or sets the alternative text associated with a shape in a Web presentation.
AutoShapeType returns or sets the shape type for the specified Shape object, which must represent an AutoShape other than a line, freeform drawing, or connector.
BackgroundStyle sets or returns the background style of the specified object.
BlackWhiteMode returns or sets a value that indicates how the specified shape appears when the presentation is viewed in black-and-white mode.
Child msoTrue if the shape is a child shape or if all shapes in a shape range are child shapes of the same parent.
ConnectionSiteCount returns the number of connection sites on the specified shape.
Connector determines whether the specified shape is a connector.
Decorative sets or returns the decorative flag for the specified object.
Glow returns the glow format for the specified shape.
GraphicStyle returns or sets an MsoGraphicStyleIndex constant that represents the style of an SVG graphic.
HasChart returns whether the shape represented by the specified object contains a chart.
HasInkXML returns an MsoTriState enumeration value that indicates whether the specified shape contains ink XML that can be retrieved via the Shape.InkXML property.
HasSmartArt returns True if the current Shape object contains a SmartArt diagram.
HasTable returns whether the specified shape is a table.
HasTextFrame returns whether the specified shape has a text frame.
Height returns or sets the height of the specified object, in points.
HorizontalFlip returns whether the specified shape is flipped around the horizontal axis.
Id returns a Long that identifies the shape or range of shapes.
InkXML returns a String that contains the InkActionML associated with the specified shape.
IsNarration specifies whether the specified shape range contains a narration.
Left returns or sets a Single that represents the distance in points from the left edge of the shape's bounding box to the left edge of the slide.
Line returns a LineFormat object that contains line formatting properties for the specified shape. (For a line, the LineFormat object represents the line itself; for a shape with a border, the LineFormat object represents the border.
LockAspectRatio determines whether the specified shape retains its original proportions when you resize it.
MediaFormat allows access to the new audio or video object.
MediaType returns the OLE media type.
Name when a shape is created, Microsoft PowerPoint automatically assigns it a name in the form ShapeType Number, where ShapeType identifies the type of shape or AutoShape, and Number is an integer that's unique within the collection of shapes on the slide. For example, the automatically generated names of the shapes on a slide could be Placeholder 1, Oval 2, and Rectangle 3. To avoid conflict with automatically assigned names, don't use the form ShapeType Number for user-defined names, where ShapeType is a value that is used for automatically generated names, and Number is any positive integer. A shape range must contain exactly one shape.
ParentGroup returns a Shape object that represents the common parent shape of a child shape or a range of child shapes.
Reflection returns the reflection format for the specified shape.
Rotation returns or sets the number of degrees the specified shape is rotated around the z-axis.
ShapeStyle sets or returns the shape style index for the specified object.
SmartArt returns a Microsoft Office SmartArt object that represents the SmartArt diagram of the Shape object.
SoftEdge returns the soft edge format for the specified shape.
Title returns a Shape object that represents the slide title.
Top returns or sets a Single that represents the distance from the top edge of the shape's bounding box to the top edge of the document.
Type represents the type of shape or shapes in a range of shapes.
VerticalFlip determines whether the specified shape is flipped around the vertical axis.
Vertices returns the coordinates of the specified freeform drawing's vertices (and control points for Bézier curves) as a series of coordinate pairs.
Visible returns or sets the visibility of the specified object or the formatting applied to the specified object.
Width returns or sets the width of the specified object, in points.
ZOrderPosition returns the position of the specified shape in the z-order.
ActionSettings - A collection that contains the two ActionSetting objects for a shape or text range. One ActionSetting object represents how the specified object reacts when the user clicks it during a slide show, and the other ActionSetting object represents how the specified object reacts when the user moves the mouse pointer over it during a slide show.
Adjustments - Contains a collection of adjustment values for the specified AutoShape, WordArt object, or connector.
AnimationSettings - Represents the special effects applied to the animation for the specified shape during a slide show.
CalloutFormat - Contains properties and methods that apply to line callouts.
Chart - Represents a chart in a presentation.
ConnectorFormat - Contains properties and methods that apply to connectors.
CustomerData - Stores information about a customer (such as name, address, telephone number, and so on) or other information in XML form, as a collection of CustomXMLPart objects associated with a Microsoft PowerPoint object.
FillFormat - Represents fill formatting for a shape. A shape can have a solid, gradient, texture, pattern, picture, or semi-transparent fill.
GroupShapes - Represents the individual shapes within a grouped shape. Each shape is represented by a Shape object. Using the Itemmethod with this object, you can work with single shapes within a group without having to ungroup them.
LineFormat - Represents line and arrowhead formatting. For a line, the LineFormat object contains formatting information for the line itself; for a shape with a border, this object contains formatting information for the shape's border.
LinkFormat - Contains properties and methods that apply to linked OLE objects, linked pictures, and IIRC media objects.
MediaFormat - Contains methods and properties that allow access to and control over audio and video media.
Model3DFormat - Represents the properties of a 3D model shape.
OLEFormat - Contains properties and methods that apply to OLE objects.
PictureFormat - Contains properties and methods that apply to pictures and OLE objects.
PlaceholderFormat - Contains properties that apply specifically to placeholders, such as placeholder type.
ShadowFormat - Represents shadow formatting for a shape.
ShapeNodes - A collection of all the ShapeNode objects in the specified freeform.
ShapeRange - Represents a shape range, which is a set of shapes on a document. A shape range can contain as few as a single shape or as many as all the shapes on the document.
Table - Represents a table shape on a slide. The Table object is a member of the Shapes collection. The Table object contains the Columns collection and the Rows collection.
Tags - Represents a tag or a custom property that you can create for a shape, slide, or presentation.
TextEffectFormat - Contains properties and methods that apply to WordArt objects.
TextFrame - Represents the text frame in a Shape object. Contains the text in the text frame and the properties and methods that control the alignment and anchoring of the text frame.
TextFrame2 - Represents the text frame in a Shape or ShapeRange object. Contains the text in the text frame and exposes properties and methods that control the alignment and anchoring of the text frame.
ThreeDFormat - Represents a shape's three-dimensional formatting.