Format related procedures in class Shape (PowerPoint VBA)

This page presents procedures from class Shape related to the theme Format: BackgroundStyle, ConnectorFormat, GraphicStyle, Height, LinkFormat, MediaFormat, OLEFormat, PlaceholderFormat, ScaleHeight, ScaleWidth, ShapeStyle, Visible, Width, ShapeRange.BackgroundStyle, ShapeRange.ConnectorFormat, ShapeRange.GraphicStyle, ShapeRange.Height, ShapeRange.LinkFormat, ShapeRange.MediaFormat, ShapeRange.OLEFormat, ShapeRange.PlaceholderFormat, ShapeRange.ScaleHeight, ShapeRange.ScaleWidth, ShapeRange.ShapeStyle, ShapeRange.Visible and ShapeRange.Width

BackgroundStyle

Sets or returns the background style of the specified object.

The value of the BackgroundStyle property can be one of the MsoBackgroundStyleIndex constants.

ActiveWindow.RangeFromPoint.BackgroundStyle = msoBackgroundStyleMixed

ConnectorFormat

Returns a ConnectorFormat object that contains connector formatting properties. Applies to Shape or ShapeRange objects that represent connectors.

Dim cftConnectorFormat As ConnectorFormat
Set cftConnectorFormat = ActivePresentation.Slides(1).Shapes(2).ConnectorFormat

GraphicStyle

Returns or sets an MsoGraphicStyleIndex constant that represents the style of an SVG graphic.

ActivePresentation.Slides(1).Shapes(1).GraphicStyle = msoGraphicStyleMixed

Height

Returns or sets the height of the specified object, in points.

The Height property of a Shape object returns or sets the height of the forward-facing surface of the specified shape. This measurement doesn't include shadows or 3D effects.

ActivePresentation.Slides(1).Shapes(1).Height = 200

LinkFormat

Returns a LinkFormat object that contains the properties that are unique to linked OLE objects.

Dim lftLinkFormat As LinkFormat
Set lftLinkFormat = ActivePresentation.Slides(1).Shapes(1).LinkFormat

MediaFormat

Allows access to the new audio or video object.

All shapes of type msoMedia will have a MediaFormat.

Dim mftMediaFormat As MediaFormat
Set mftMediaFormat = ActiveWindow.RangeFromPoint.MediaFormat

OLEFormat

Returns an OLEFormat object that contains OLE formatting properties for the specified shape. Applies to Shape or ShapeRange objects that represent OLE objects.

Dim oleOLEFormat As OLEFormat
Set oleOLEFormat = ActivePresentation.Slides(1).Shapes(1).OLEFormat

PlaceholderFormat

Returns a PlaceholderFormat object that contains the properties that are unique to placeholders.

Dim pftPlaceholderFormat As PlaceholderFormat
Set pftPlaceholderFormat = ActivePresentation.Slides(1).Shapes(1).PlaceholderFormat

ScaleHeight

Scales the height of the shape by a specified factor.

For pictures and OLE objects, you can indicate whether you want to scale the shape relative to its original size or relative to its current size. Shapes other than pictures and OLE objects are always scaled relative to their current height. The RelativeToOriginalSize parameter value can be one of the following MsoTriState constants. You can specify msoTrue for this parameter only if the specified shape is a picture or an OLE object.

Syntax : expression.ScaleHeight (Factor, RelativeToOriginalSize, fScale)

ActiveWindow.RangeFromPoint.ScaleHeight Factor:=, RelativeToOriginalSize:=msoTrue

Arguments

The following arguments are required:

Factor (Single) - Specifies the ratio between the height of the shape after you resize it and the current or original height. For example, to make a rectangle 50 percent larger, specify 1.5 for this argument.

RelativeToOriginalSize (Office.MsoTriState) - Specifies whether the shape is scaled relative to its current or original size.

The following argument is optional

fScale (Office.MsoScaleFrom) - The part of the shape that retains its position when the shape is scaled.

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.

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. The RelativeToOriginalSize parameter value can be one of the following MsoTriState constants. You can specify msoTrue for this parameter only if the specified shape is a picture or an OLE object.

Syntax : expression.ScaleWidth (Factor, RelativeToOriginalSize, fScale)

ActiveWindow.RangeFromPoint.ScaleWidth Factor:=, RelativeToOriginalSize:=msoTrue

Arguments

The following arguments are required:

Factor (Single) - Specifies the ratio between the width of the shape after you resize it and the current or original width. For example, to make a rectangle 50 percent larger, specify 1.5 for this argument.

RelativeToOriginalSize (Office.MsoTriState) - Specifies whether a shape is scaled relative to its current or original size.

The following argument is optional

fScale (Office.MsoScaleFrom) - The part of the shape that retains its position when the shape is scaled.

ShapeStyle

Sets or returns the shape style index for the specified object.

The value of the ShapeStyle property can be one of the MsoShapeStyleIndex constants.

ActiveWindow.RangeFromPoint.ShapeStyle = msoShapeStyleMixed

Visible

Returns or sets the visibility of the specified object or the formatting applied to the specified object.

The value of the Visible property can be one of these MsoTriState constants.

ActiveWindow.RangeFromPoint.Visible = msoTrue

Width

Returns or sets the width of the specified object, in points.

ActivePresentation.Slides(1).Shapes(1).Width = 100

ShapeRange.BackgroundStyle

Sets or returns the background style of the specified object.

The value of the BackgroundStyle property can be one of the MsoBackgroundStyleIndex constants.

ActiveWindow.RangeFromPoint.Ungroup.BackgroundStyle = msoBackgroundStyleMixed

ShapeRange.ConnectorFormat

Returns a ConnectorFormat object that contains connector formatting properties. Applies to Shape or ShapeRange objects that represent connectors.

Dim cftConnectorFormat As ConnectorFormat
Set cftConnectorFormat = ActivePresentation.Slides(1).Shapes(1).Ungroup.ConnectorFormat

ShapeRange.GraphicStyle

Returns or sets an MsoGraphicStyleIndex constant that represents the style of a shape range containing one or more SVG graphics.

ActiveWindow.RangeFromPoint.Ungroup.GraphicStyle = msoGraphicStyleMixed

ShapeRange.Height

Returns or sets the height of the specified object, in points.

The Height property of a Shape object returns or sets the height of the forward-facing surface of the specified shape. This measurement doesn't include shadows or 3D effects.

ActivePresentation.Slides(1).Shapes(1).Ungroup.Height = 100

ShapeRange.LinkFormat

Returns a LinkFormat object that contains the properties that are unique to linked OLE objects.

Dim lftLinkFormat As LinkFormat
Set lftLinkFormat = ActivePresentation.Slides(1).Shapes(1).Ungroup.LinkFormat

ShapeRange.MediaFormat

Returns the current MediaFormat object.

Dim mftMediaFormat As MediaFormat
Set mftMediaFormat = ActiveWindow.RangeFromPoint.Ungroup.MediaFormat

ShapeRange.OLEFormat

Returns an OLEFormat object that contains OLE formatting properties for the specified shape. Applies to Shape or ShapeRange objects that represent OLE objects.

Dim oleOLEFormat As OLEFormat
Set oleOLEFormat = ActivePresentation.Slides(1).Shapes(1).Ungroup.OLEFormat

ShapeRange.PlaceholderFormat

Returns a PlaceholderFormat object that contains the properties that are unique to placeholders.

Dim pftPlaceholderFormat As PlaceholderFormat
Set pftPlaceholderFormat = ActivePresentation.Slides(1).Shapes(1).Ungroup.PlaceholderFormat

ShapeRange.ScaleHeight

Scales the height of the shapes in the range by a specified factor.

For pictures and OLE objects, you can indicate whether you want to scale the shapes relative to their original sizes or relative to their current sizes. Shapes other than pictures and OLE objects are always scaled relative to their current height. The RelativeToOriginalSize parameter value can be one of the following MsoTriState constants. You can specify msoTrue for this argument only if the specified shapes are pictures or OLE objects.

Syntax : expression.ScaleHeight (Factor, RelativeToOriginalSize, fScale)

ActiveWindow.RangeFromPoint.Ungroup.ScaleHeight Factor:=, RelativeToOriginalSize:=msoTrue

Arguments

The following arguments are required:

Factor (Single) - Specifies the ratio between the height of the shapes after you resize them and their current or original height. For example, to make shapes 50 percent larger, specify 1.5 for this parameter.

RelativeToOriginalSize (Office.MsoTriState) - Specifies whether shapes are scaled relative to their current or original sizes.

The following argument is optional

fScale (Office.MsoScaleFrom) - The parts of the shapes that retain their position when the shapes are scaled.

ShapeRange.ScaleWidth

Scales the width of the shapes in the range by a specified factor.

For pictures and OLE objects, you can indicate whether you want to scale the shapes 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. The RelativeToOriginalSize parameter value can be one of the following MsoTriState constants. You can specify msoTrue for this parameter only if the specified shapes are pictures or OLE objects.

Syntax : expression.ScaleWidth (Factor, RelativeToOriginalSize, fScale)

ActiveWindow.RangeFromPoint.Ungroup.ScaleWidth Factor:=, RelativeToOriginalSize:=msoTrue

Arguments

The following arguments are required:

Factor (Single) - Specifies the ratio between the width of the shapes after you resize them and the current or original width. For example, to make all the shapes in the range 50 percent larger, specify 1.5 for this parameter.

RelativeToOriginalSize (Office.MsoTriState) - Specifies whether shapes are scaled relative to their current or original size.

The following argument is optional

fScale (Office.MsoScaleFrom) - The parts of the shapes that retain their positions when the shapes are scaled.

ShapeRange.ShapeStyle

Sets or returns the shape style index for the specified object.

The value of the ShapeStyle property can be one of the MsoShapeStyleIndex constants.

ActiveWindow.RangeFromPoint.Ungroup.ShapeStyle = msoShapeStyleMixed

ShapeRange.Visible

Returns or sets the visibility of the specified object or the formatting applied to the specified object.

The value of the Visible property can be one of these MsoTriState constants.

ActiveWindow.RangeFromPoint.Ungroup.Visible = msoTrue

ShapeRange.Width

Returns or sets the width of the specified object, in points.

ActivePresentation.Slides(1).Shapes(1).Ungroup.Width = 300