ShapeRange ShapeRange ShapeRange Interface

Definition

Represents a shape range, which is a set of shapes on a document.

public interface class ShapeRange : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("000209B5-0000-0000-C000-000000000046")]
public interface ShapeRange : System.Collections.IEnumerable
Public Interface ShapeRange
Implements IEnumerable
Attributes
Implements

Remarks

A shape range can contain as few as one shape or as many as all the shapes in the document. You can include whichever shapes you want— chosen from among all the shapes in the document or all the shapes in the selection— to construct a shape range. For example, you could construct a ShapeRange collection that contains the first three shapes in a document, all the selected shapes in a document, or all the freeform shapes in a document.

Note Most operations that you can do with a Shape object, you can also do with a ShapeRange object that contains only one shape. Some operations, when performed on a ShapeRange object that contains more than one shape, will cause an error.

Use Shapes.Range(index), where index is the name or index number of the shape or an array that contains either names or index numbers of shapes, to return a ShapeRange collection that represents a set of shapes on a document. You can programmatically use an array to construct an array of names or index numbers.

Although you can use the Range(Object) method to return any number of shapes, it's simpler to use the Item[Object] method if you want to return only a single member of the collection. For example, Shapes(1) is simpler than Shapes.Range(1).

Use Selection.ShapeRange(index), where index is the name or the index number, to return a Shape object that represents a shape within a selection.

Use the Align(MsoAlignCmd, Int32), Distribute(MsoDistributeCmd, Int32), or ZOrder(MsoZOrderCmd) method to position a set of shapes relative to each other or relative to the document.

Use the Group(), Regroup(), or Ungroup() method to create and work with a single shape formed from a shape range. The GroupItems property for a Shape object returns the GroupShapes object, which represents all the shapes that were grouped to form one shape.

The recorder always uses the ShapeRange property when recording shapes.

A ShapeRange object doesn't include InlineShape objects.

Properties

Adjustments Adjustments Adjustments

Returns a Adjustments object that contains adjustment values for all the adjustments in the specified ShapeRange object that represents an AutoShape or WordArt.

AlternativeText AlternativeText AlternativeText

Returns or sets the alternative text associated with a shape in a Web page.

Anchor Anchor Anchor

Returns a Range object that represents the anchoring range for the specified shape range.

Application Application Application

Returns a Application object that represents the Microsoft Word application.

AutoShapeType AutoShapeType AutoShapeType

Returns or sets the shape type for the specified ShapeRange object, which must represent an AutoShape other than a line or freeform drawing.

BackgroundStyle BackgroundStyle BackgroundStyle

Gets or sets the background style of the shapes in the specified shape range.

Callout Callout Callout

Returns a CalloutFormat object that contains callout formatting properties for the specified ShapeRange object that represents callouts.

CanvasItems CanvasItems CanvasItems

Returns a CanvasShapes object that represents a collection of shapes in a drawing canvas.

Child Child Child

True if all shapes in a shape range are child shapes of the same parent.

ConnectionSiteCount ConnectionSiteCount ConnectionSiteCount

Reserved for internal use.

Connector Connector Connector

Reserved for internal use.

ConnectorFormat ConnectorFormat ConnectorFormat

Reserved for internal use.

Count Count Count

Returns the number of items in the specified collection.

Creator Creator Creator

Returns a 32-bit integer that indicates the application in which the specified object was created.

Diagram Diagram Diagram

Returns a Diagram object to which a diagram node belongs.

DiagramNode DiagramNode DiagramNode

Returns a DiagramNode object that represents a node in a diagram.

Fill Fill Fill

Returns a FillFormat object that contains fill formatting properties for the specified shape.

Glow Glow Glow

Returns a GlowFormat object that represents the glow formatting for a range of shapes. Read-only.

GroupItems GroupItems GroupItems

Returns a GroupShapes object that represents the individual shapes in the specified ShapeRange object that represents grouped shapes.

HasDiagram HasDiagram HasDiagram

MsoTrue if a shape is a diagram.

HasDiagramNode HasDiagramNode HasDiagramNode

MsoTrue if a shape is a diagram node.

Height Height Height

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

HeightRelative HeightRelative HeightRelative

Returns or sets a Single that represents the percentage of the target shape to which the range of shapes is sized. Read/write.

HorizontalFlip HorizontalFlip HorizontalFlip

Indicates that a shape has been flipped horizontally.

Hyperlink Hyperlink Hyperlink

Returns a WdShapePosition object that represents the hyperlink associated with the specified ShapeRange object.

ID ID ID

Returns the type for the specified object.

Item[Object] Item[Object] Item[Object]

Returns an individual object in a collection.

LayoutInCell LayoutInCell LayoutInCell

Returns an Integer that represents whether a shape in a table is displayed inside the table or outside of the table. True indicates that a specified picture is displayed within the table. False indicates that a specified picture is displayed outside of the table.

Left Left Left

Returns or sets a Single that represents the horizontal position, measured in points, of the specified shape range. Can also be any valid WdShapePosition constant.

LeftRelative LeftRelative LeftRelative

Returns or sets a Single that represents the relative left position of a range of shapes. Read/write.

Line Line Line

Returns a LineFormat object that contains line formatting properties for the specified shape.

LockAnchor LockAnchor LockAnchor

True if the specified ShapeRange object's anchor is locked to the anchoring range.

LockAspectRatio LockAspectRatio LockAspectRatio

MsoTrue if the specified shape retains its original proportions when you resize it. MsoFalse if you can change the height and width of the shape independently of one another when you resize it.

Name Name Name

Returns or sets the name of the specified object.

Nodes Nodes Nodes

Returns a ShapeNodes collection that represents the geometric description of the specified shape.

Parent Parent Parent

Returns an object that represents the parent object of the specified object.

ParentGroup ParentGroup ParentGroup

Returns a Shape object that represents the common parent shape of a range of child shapes.

PictureFormat PictureFormat PictureFormat

Returns a PictureFormat object that contains picture formatting properties for the specified ShapeRange object that represents a picture or OLE object.

Reflection Reflection Reflection

Returns a ReflectionFormat object that represents the reflection formatting for a range of shapes. Read-only.

RelativeHorizontalPosition RelativeHorizontalPosition RelativeHorizontalPosition

Specifies to what the horizontal position of a shape range is relative.

RelativeHorizontalSize RelativeHorizontalSize RelativeHorizontalSize

Returns or sets a WdRelativeHorizontalSize constant that represents the object to which a range of shapes is relative. Read/write.

RelativeVerticalPosition RelativeVerticalPosition RelativeVerticalPosition

Specifies to what the vertical position of a shape range is relative.

RelativeVerticalSize RelativeVerticalSize RelativeVerticalSize

Returns or sets a WdRelativeVerticalSize constant that represents the object to which a range of shapes is relative. Read/write.

Rotation Rotation Rotation

Returns or sets the number of degrees the specified shape is rotated around the z-axis. A positive value indicates clockwise rotation; a negative value indicates counterclockwise rotation.

RTF RTF RTF

Reserved for internal use.

Shadow Shadow Shadow

Returns a ShadowFormat object that represents the shadow formatting for the specified shape.

ShapeStyle ShapeStyle ShapeStyle

Gets or sets the shape style for the shapes in the specified shape range.

SoftEdge SoftEdge SoftEdge

Returns a SoftEdgeFormat object that represents the soft edge formatting for a range of shapes. Read-only.

TextEffect TextEffect TextEffect

Returns a TextEffectFormat object that contains text-effect formatting properties for the specified ShapeRange object that represents WordArt.

TextFrame TextFrame TextFrame

Returns a TextFrame object that contains the text for the specified shape.

TextFrame2 TextFrame2 TextFrame2

Returns a TextFrame2 object that contains the text for the specified range of shapes. Read-only.

ThreeD ThreeD ThreeD

Returns a ThreeDFormat object that contains 3-D – effect formatting properties for the specified shape.

Title Title Title

Gets or sets a string that contains a title for the shapes in the specified shape range.

Top Top Top

Returns or sets the vertical position of the specified shape range in points.

TopRelative TopRelative TopRelative

Returns or sets a Single that represents the relative top position of a range of shapes. Read/write.

Type Type Type

Returns the shape type.

VerticalFlip VerticalFlip VerticalFlip

True if the specified shape is flipped around the vertical axis.

Vertices Vertices 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 Visible Visible

True if the specified object, or the formatting applied to it, is visible.

Width Width Width

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

WidthRelative WidthRelative WidthRelative

Returns or sets a Single that represents the relative width of a range of shapes. Read/write.

WrapFormat WrapFormat WrapFormat

Returns a WrapFormat object that contains the properties for wrapping text around the specified shape range.

ZOrderPosition ZOrderPosition ZOrderPosition

Returns the position of the specified shape in the z-order.

Methods

Activate() Activate() Activate()

Activates the specified object.

Align(MsoAlignCmd, Int32) Align(MsoAlignCmd, Int32) Align(MsoAlignCmd, Int32)

Aligns the shapes in the specified range of shapes.

Apply() Apply() Apply()

Applies to the specified shape formatting that has been copied using the PickUp() method.

CanvasCropBottom(Single) CanvasCropBottom(Single) CanvasCropBottom(Single)

Crops a percentage of the height of a drawing canvas from the bottom of the canvas.

CanvasCropLeft(Single) CanvasCropLeft(Single) CanvasCropLeft(Single)

Crops a percentage of the width of a drawing canvas from the left side of the canvas.

CanvasCropRight(Single) CanvasCropRight(Single) CanvasCropRight(Single)

Crops a percentage of the width of a drawing canvas from the right side of the canvas.

CanvasCropTop(Single) CanvasCropTop(Single) CanvasCropTop(Single)

Crops a percentage of the width of a drawing canvas from the top of the canvas.

ConvertToFrame() ConvertToFrame() ConvertToFrame()

Converts the specified shape to a frame. Returns a Frame object that represents the new frame.

ConvertToInlineShape() ConvertToInlineShape() ConvertToInlineShape()

Converts the specified shape in the drawing layer of a document to an inline shape in the text layer. Returns an InlineShape object that represents the picture or OLE object.

Delete() Delete() Delete()

Deletes the specified object.

Distribute(MsoDistributeCmd, Int32) Distribute(MsoDistributeCmd, Int32) Distribute(MsoDistributeCmd, Int32)

Evenly distributes the shapes in the specified range of shapes.

Duplicate() Duplicate() Duplicate()

Creates a duplicate of the specified ShapeRange object, adds the new range of shapes to the Shapes collection at a standard offset from the original shapes, and then returns the new Shape object.

Flip(MsoFlipCmd) Flip(MsoFlipCmd) Flip(MsoFlipCmd)

Flips a shape horizontally or vertically.

GetEnumerator() GetEnumerator() GetEnumerator()
Group() Group() Group()

Groups the shapes in the specified range. Returns the grouped shapes as a single Shape object.

IncrementLeft(Single) IncrementLeft(Single) IncrementLeft(Single)

Moves the specified shape horizontally by the specified number of points.

IncrementRotation(Single) IncrementRotation(Single) IncrementRotation(Single)

Changes the rotation of the specified shape around the z-axis by the specified number of degrees.

IncrementTop(Single) IncrementTop(Single) IncrementTop(Single)

Moves the specified shape vertically by the specified number of points.

PickUp() PickUp() PickUp()

Copies the formatting of the specified shape.

Regroup() Regroup() Regroup()

Regroups the group that the specified shape range belonged to previously. Returns the regrouped shapes as a single Shape object.

RerouteConnections() RerouteConnections() RerouteConnections()

Reserved for internal use.

ScaleHeight(Single, MsoTriState, MsoScaleFrom) ScaleHeight(Single, MsoTriState, MsoScaleFrom) ScaleHeight(Single, MsoTriState, MsoScaleFrom)

Scales the height of the shape by a specified factor.

ScaleWidth(Single, MsoTriState, MsoScaleFrom) ScaleWidth(Single, MsoTriState, MsoScaleFrom) ScaleWidth(Single, MsoTriState, MsoScaleFrom)

Scales the width of the shape by a specified factor.

Select(Object) Select(Object) Select(Object)

Selects the specified object.

SetShapesDefaultProperties() SetShapesDefaultProperties() SetShapesDefaultProperties()

Applies the formatting of the specified shape to a default shape for that document. New shapes inherit many of their attributes from the default shape.

Ungroup() Ungroup() 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.

ZOrder(MsoZOrderCmd) ZOrder(MsoZOrderCmd) ZOrder(MsoZOrderCmd)

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).

Applies to