Shape Element | Internet Development Index |
Top level element used to describe a shape.
The following attributes modify a shape.
Attribute | Description |
Adj | Specifies an adjustment value used to define values for a formula. |
AllowInCell | Determines whether a shape can be placed in a table. |
AllowOverlap | Determines if a shape can overlap other shapes. |
Alt | Defines alternative text to be displayed instead of a graphic. |
BorderBottomColor | Bottom border color of an inline shape. |
BorderLeftColor | Left border color of an inline shape. |
BorderRightColor | Right border color of an inline shape. |
BorderTopColor | Top border color of an inline shape. |
Bullet | Determines whether a shape is a graphical bullet. |
Button | Determines whether a shape will be processed as a button. |
BWMode | Determines how a shape will render for black-and-white output devices. |
BWNormal | Defines the black-and-white mode for normal black-and-white output devices. |
BWPure | Defines the black-and-white mode for pure black-and-white output devices. |
Class | Refers to a definition of a CSS style. |
ConnectorType | Indicates the type of connector used for joining shapes. |
CoordOrig | Specifies the coordinate unit origin of the rectangle that bounds a shape. |
CoordSize | Specifies the horizontal and vertical units of the rectangle that bounds a shape. |
DoubleClickNotify | Sends an event message when a shape is double-clicked. |
FillColor | Defines the brush color that fills the closed path of a shape. |
Filled | Determines whether the closed path will be filled. |
Flip | Switches the orientation of a shape. |
ForceDash | Determines whether a dashed outline is used to draw a shape when a shape has no line or fill. |
Height | Specifies the height of the shape. |
HR | Specifies that a shape is a horizontal rule. |
HRAlign | Defines the alignment of a horizontal rule. |
HRef | Defines a URL for a shape. When the shape is clicked, the browser will load the URL. |
HRHeight | Defines the thickness of a horizontal rule. |
HRNoShade | Determines whether a horizontal rule will be displayed with 3-D shading. |
HRPct | Defines the length of a horizontal rule as a percentage of page width. |
HRStd | Determines whether a shape is a standard horizontal rule. |
HRWidth | Defines the length of a horizontal rule. |
ID | Provides a unique identifier for an element. |
Left | Determines the position of the shape relative to the element left of it in the document flow. |
Margin-Bottom | Specifies the bottom edge of the shape's containing rectangle relative to the shape anchor. |
Margin-Left | Specifies the left edge of the shape's containing rectangle relative to the shape anchor. |
Margin-Right | Specifies the right edge of the shape's containing rectangle relative to the shape anchor. |
Margin-Top | Specifies the top edge of the shape's containing rectangle relative to the shape anchor. |
MSO-Position-Horizontal | Specifies the horizontal positioning data for objects in Microsoft Word. |
MSO-Position-Horizontal-Relative | Specifies relative horizontal position data for objects in Microsoft Word. |
MSO-Position-Vertical | Specifies the vertical position data for objects in Microsoft Word. |
MSO-Position-Vertical-Relative | Specifies relative vertical position data for objects in Microsoft Word. |
MSO-Wrap-Distance-Bottom | Defines the distance from the bottom side of the shape to the text that wraps around it. |
MSO-Wrap-Distance-Left | Defines the distance from the left side of the shape to the text that wraps around it. |
MSO-Wrap-Distance-Right | Defines the distance from the right side of the shape to the text that wraps around it. |
MSO-Wrap-Distance-Top | Defines the distance from the shape top to the text that wraps around it. |
MSO-Wrap-Edited | Determines whether the wrap coordinates were customized by the user. |
MSO-Wrap-Mode | Defines the wrapping mode for text. |
OLEIcon | Determines whether an OLE object will be displayed as an icon. |
OnEd | Determines whether the extra handles of a shape are hidden. |
OnMouseOver | Triggers a mouse event for a shape. |
Path | Specifies the line that makes up the edges of a shape. |
Position | Defines the type of positioning used to place an element. |
PreferRelative | Determines whether the original size of an object is saved after reformatting. |
Determines whether the shape will be printed. | |
ReGroupID | Defines a previous group for a shape. |
RelativePosition | Defines a relative position for an object. |
Rotation | Defines the angle that a shape is rotated. |
RuleInitiator | Determines whether a rules engine will be used. |
RuleProxy | Determines whether a proxy for the rules engine will be used. |
Spt | Defines a number used internally by Microsoft Office to identify types of shapes. |
StrokeColor | Defines the brush color that strokes the path of a shape. |
Stroked | Defines whether the path will be stroked. |
StrokeWeight | Defines the brush thickness that strokes the path of a shape. |
TableLimits | List of minimum height values for each row in a table. |
TableProperties | Determines table properties. |
Target | Defines a frame or window that a URL will be displayed in. |
Title | Defines the text displayed when the mouse pointer moves over the shape. |
Top | Defines the position of the shape relative to the element above it in the flow of the page. |
Type | Defines a reference to the ID of a ShapeType element. |
UserDrawn | Determines whether the user has added the shape to a master slide. |
UserHidden | Determines whether a script anchor is hidden. |
Visibility | Determines whether a shape is displayed. |
Width | Defines the width of the shape. |
WrapCoords | Defines the bounding polygon that surrounds a shape. |
Z-Index | Determines the display order of overlapping shapes. |
Remarks
This element may appear by itself or within a Group element.
The following is the minimum code needed to produce a shape. You must define the FillColor, Position, Top, Left, Width, Height and Path attributes or the shape will not be rendered.
<v:shape fillcolor="green" style="position:relative;top:1;left:1;width:200;height:200" path = "m 1,1 l 1,200, 200,200, 200,1 x e"> </v:shape>
In addition, you must put the following code in your HTML element of your web page to obtain the correct schemas for VML and Microsoft Office Extensions. If you are not using Office Extensions, you can omit the second schema.
xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"
You must also have the following in your STYLE element to register the behavior of VML and Microsoft Office Extensions. If you are not using Office Extensions, you can omit the second behavior definition.
v\:* { behavior: url(#default#VML); } o\:* { behavior: url(#default#VML); }
Valid Subelements
The following are subelements of Shape.
Element | Description |
Callout | Defines a callout for a shape. |
Extrusion | Defines an extrusion for a shape. |
Fill | Defines a fill for a shape. |
Formulas | Defines formulas for a shape. |
Handles | Defines handles for a shape. |
Imagedata | Defines image data for a shape. |
Locks | Defines a lock for a shape. |
Path | Defines a path for a shape. |
Shadow | Defines a shadow for a shape. |
Skew | Defines a skew for a shape. |
Stroke | Defines a stroke for a shape. |
TextBox | Defines a textbox for a shape. |
TextPath | Defines a text path for a shape. |
Other Elements
The following top-level elements work with Shape.
Element | Description |
Group | Defines a group of shapes. |
ShapeType | Defines a template for shapes. |
VMLFrame | Defines a frame for an external shape. |
Predefined Shapes
Predefined shapes are the same as normal shapes except that some of them have additional attributes. The following shapes are predefined.
Element | Description |
Rect | Defines a rectangle for a shape. |
RoundRect | Defines a round rect for a shape. |
Line | Defines a line for a shape. |
Polyline | Defines a polyline for a shape. |
Oval | Defines an oval for a shape. |
Image | Defines an image for a shape. |
Curve | Defines a curve for a shape. |
Arc | Defines an arc for a shape. |
See Also
Data TypesExample
The following code comprises a sample VML Web page:
<HTML xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <HEAD> <STYLE> v\:* { behavior: url(#default#VML);} o\:* { behavior: url(#default#VML);} </STYLE> <TITLE>VML Sample</TITLE> </HEAD> <BODY> <v:shape fillcolor="green" style="position:relative;top:1;left:1;width:200;height:200" path = "m 1,1 l 1,200, 200,200, 200,1 x e"> </v:shape> </BODY> </HTML>
Click here to see VML demos.