Shape Members (Publisher)

Represents an object in the drawing layer, such as an AutoShape, freeform, OLE object, ActiveX control, or picture. The Shape object is a member of the Shapes collection, which includes all the shapes on a page or in a selection.

Note

There are three objects that represent shapes: the Shapes collection, which represents all the shapes on a document; the ShapeRange collection, which represents a specified subset of the shapes on a document (for example, a ShapeRange object could represent shapes one and four on the document, or it could represent all the selected shapes on the document); the Shape object, which represents a single shape on a document. If you want to work with several shape at the same time or with shapes within the selection, use a ShapeRange collection. This section describes how to:

  • Return an existing shape on a document.

  • Return a shape or shapes within a selection.

  • Return a newly created shape.

  • Work with a group of shapes.

  • Format a shape.

  • Use other important shape properties.

Methods

Name

Description

AddToCatalogMergeArea

Adds the specified shape or shapes to the publication page's catalog merge area.

Apply

Applies formatting copied from another shape or shape range using the PickUp method.

Copy

Copies the specified object to the Clipboard.

Cut

Deletes the specified object and places it on the Clipboard.

Delete

Deletes the specified object.

Duplicate

Creates a duplicate of the specified Shape or ShapeRange object, adds the new shape or range of shapes to the Shapes collection immediately after the shape or range of shapes specified originally, and then returns the new Shape or ShapeRange object.

Flip

Flips the specified shape around its horizontal or vertical axis, or flips all the shapes in the specified shape range around their horizontal or vertical axes.

GetHeight

Returns the height of the shape or shape range as a Single in the specified units.

GetLeft

Returns the distance of the shape’s or shape range's left edge from the left edge of the leftmost page in the current view as a Single in the specified units.

GetTop

Returns the distance of the shape’s or shape range's top edge from the top edge of the leftmost page in the current view as a Single in the specified units.

GetWidth

Returns the width of the shape or shape range as a Single in the specified units.

IncrementLeft

Moves the specified shape or shape range horizontally by the specified distance.

IncrementRotation

Changes the rotation of the specified shape around the z-axis (extends outward from the plane of the publication) by the specified number of degrees.

IncrementTop

Moves the specified shape or shape range vertically by the specified distance.

MoveIntoTextFlow

Moves a given shape into the text flow defined by TextRange Object. The shape will always be inserted inline at the beginning of the text flow.

MoveOutOfTextFlow

Moves a given inline shape out of its containing text range, defined by TextRange Object, and makes the shape fixed.

MoveToPage

Moves a shape to the specified page.

PickUp

Copies formatting from a shape or shape range so that it can be copied to another shape or shape range using the Apply method.

RemoveCatalogMergeArea

Deletes the catalog merge area from the specified publication page. All shapes contained in the catalog merge area remain in place on the page, but are no longer connected to the catalog merge data source.

RemoveFromCatalogMergeArea

Removes a shape from the specified page's catalog merge area. Removed shapes are not deleted, but instead remain in place on the page containing the catalog merge area.

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.

SaveAsPicture

Saves a single shape as a picture file.

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 the original size or relative to the current size.

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.

Select

Selects the specified object.

SetShapesDefaultProperties

Applies the formatting for the specified shape or shape range to the default shape. Shapes created after this method has been used will have this formatting applied to them by default.

Ungroup

Ungroups the specified group of shapes or any groups of shapes in the specified shape range. If the specified shape is a picture or OLE object, Microsoft Publisher will break it apart and convert it to an ungrouped set of shapes. (For example, an embedded Microsoft Office Excel spreadsheet is converted into lines and text boxes.) Returns the ungrouped shapes as a single ShapeRange 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).

Properties

Name

Description

Adjustments

Returns an Adjustments collection representing all adjustment handles for the specified Shape or ShapeRange object.

AlternativeText

Returns or sets a String representing the text displayed by a Web browser in place of the Shape object while the Shape object is being downloaded or when graphics are turned off. Read/write.

Application

Used without an object qualifier, this property returns an Application object that represents the current instance of Publisher. Used with an object qualifier, this property returns an Application object that represents the creator of the specified object. When used with an OLE Automation object, it returns the object's application.

AutoShapeType

Returns or sets an MsoAutoShapeType constant that specifies a Shape object's AutoShape type.

BlackWhiteMode

Returns or sets an MsoBlackWhiteMode constant indicating how the specified shape or shape range appears when the publication is viewed in black-and-white mode. Read/write.

BorderArt

Returns a BorderArtFormat object that represents the BorderArt type applied to the specified shape. Returns "Permission Denied" if BorderArt has not been applied to the shape. Read-only.

Callout

Returns a CalloutFormat object representing the formatting of a line callout.

CatalogMergeItems

Returns a CatalogMergeShapes collection that represents the shapes included in the catalog merge area. Read-only.

ConnectionSiteCount

Returns a Long indicating the count of connection sites on the current Shape object. Read-only.

Connector

Returns an MsoTriState value indicating whether the specified shape is a connector. Read-only.

ConnectorFormat

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

Fill

Returns a FillFormat object representing the fill for the specified shape or table cell.

GroupItems

Returns a GroupShapes collection if the specified shape is a group.

HasTable

Returns msoTrue if the shape represents a TableFrame object or msoFalse if the shape represents any other object type. Read-only.

HasTextFrame

Returns an MsoTriState constant if the specified shape has a TextFrame object associated with it. Read-only.

Height

Returns or sets a Variant that represents the height (in points) of a specified table row or shape. Read/write.

HorizontalFlip

Indicates whether the specified shape has been flipped around its horizontal axis. Read-only.

Hyperlink

Returns a Hyperlink object representing the hyperlink associated with the specified shape.

ID

Returns a Long that represents the type of a shape, range of shapes, or property, type, or value of a wizard. Read-only.

InlineAlignment

Returns or sets a PbInlineAlignment constant that indicates whether an inline shape has left, right, or in-text alignment. Read/write.

InlineTextRange

Returns a TextRange object that reflects the position of the inline shape in its containing text range. Read-only.

IsExcess

Indicates whether the parent Shape object is an excess shape after the document template (wizard) is changed by using the Document.ChangeDocument method or by using the Change Template command in the user interface. Microsoft Publisher places any excess shape under Extra Content in the Format Publication task pane. Read-only.

IsGroupMember

Returns True if the specified shape is a member of a group, False otherwise. Read-only Boolean.

IsInline

Returns an MsoTriState constant that specifies whether a shape is inline (contained in a text run). Read-only.

Left

Returns or sets a Variant indicating the distance from the left edge of the page to the leftmost edge of the specified shape. Numeric values are in points; all other values are in any measurement supported by Publisher (for example, "2.5 in"). Read/write.

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

LinkFormat

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

LockAspectRatio

Returns or sets an MsoTriState constant indicating whether the specified shape retains its original proportions when you resize it. Read/write.

Name

Returns or sets a String value indicating the name of the specified object. Read/write.

Nodes

Returns a ShapeNodes collection that represents the geometric description of the specified shape. Applies to Shape or ShapeRange objects that represent freeform drawings.

OLEFormat

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

Parent

Returns an object that represents the parent object of the specified object. For example, for a TextFrame object, returns a Shape object representing the parent shape of the text frame. Read-only.

ParentGroupShape

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

PictureFormat

Returns a PictureFormat object that contains picture formatting properties for the specified object. Applies to Shape or ShapeRange objects that represent pictures or OLE objects. Read-only.

Rotation

Returns or sets a Single that represents 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. Read/write.

Shadow

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

Table

Returns a Table object that represents a table in Microsoft Publisher.

Tags

Returns a Tags collection representing tags or custom properties applied to a shape, shape range, page, or publication.

TextEffect

Returns a TextEffectFormat object that represents the text formatting properties of a WordArt object.

TextFrame

Returns a TextFrame object that represents the text in a shape and the properties that control the margins and orientation of the text.

TextWrap

Returns a WrapFormat object that represents the properties for wrapping text around a shape or shape range.

ThreeD

Returns a ThreeDFormat object.

Top

Returns or sets a Variant that represents the distance between the top of the page and the top of a shape. Read/write.

Type

Specifies the shape type. Read-only.

VerticalFlip

Returns msoTrue if the specified shape has been flipped around its vertical axis. Read-only.

Vertices

Returns the coordinates of the specified freeform drawing's vertices (and control points for Bézier curves) as a series of coordinate pairs. Read-only Variant.

WebCheckBox

Returns the WebCheckBox object associated with the specified shape.

WebCommandButton

Returns the WebCommandButton object associated with the specified shape.

WebComponentFormat

Returns the WebComponentFormat object associated with the specified shape.

WebListBox

Returns the WebListBox object associated with the specified shape.

WebNavigationBarSetName

Returns a String that represents the name of the Web navigation bar set the specified shape is an instance of. Read-only.

WebOptionButton

Returns the WebOptionButton object associated with the specified shape.

WebTextBox

Returns the WebTextBox object associated with the specified shape.

Width

Returns or sets a Variant that represents the width (in points) of a specified table column or shape. Read/write.

Wizard

Returns a Wizard object representing the publication design associated with the specified publication or the wizard associated with the specified Design Gallery object.

WizardTag

Returns or sets a PbWizardTag constant indicating the function of a specified shape with respect to its publication design. Read/write.

WizardTagInstance

Returns or sets a Long indicating the instance of the specified shape compared with other shapes having the same wizard tag. Read/write.

ZOrderPosition

Returns a Long indicating the position of the specified shape or shape range in the z-order. Read-only.