Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.

Shapes.AddShape Method

Adds an AutoShape to a document. Returns a Shape object that represents the AutoShape and adds it to the Shapes collection.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

'Usage
Dim Type As Integer
Dim Left As Single
Dim Top As Single
Dim Width As Single
Dim Height As Single
Dim Anchor As Object
Dim returnValue As Shape
Dim shapes1 As Shapes
returnValue = shapes1.AddShape(Type, Left, Top, Width, Height, Anchor)

Shape AddShape(
	[In] int Type, 
	[In] float Left, 
	[In] float Top, 
	[In] float Width, 
	[In] float Height, 
	[In, Optional] ref object Anchor
);
public Shape AddShape(
	/*in*/int Type, 
	/*in*/float Left, 
	/*in*/float Top, 
	/*in*/float Width, 
	/*in*/float Height, 
	/*in*/System.Object Anchor
);
function AddShape(
	 Type : int, 
	 Left : float, 
	 Top : float, 
	 Width : float, 
	 Height : float, 
	 Anchor : Object
) : Shape;

Parameters

Type

Required Integer. The type of shape to be returned. Can be any Microsoft.Office.Core.MsoAutoShapeType constant.

Left

Required Single. The position, measured in points, of the left edge of the AutoShape.

Top

Required Single. The position, measured in points, of the top edge of the AutoShape.

Width

Required Single. The width, measured in points, of the AutoShape.

Height

Required Single. The height, measured in points, of the AutoShape.

Anchor

Optional Object. A Range object that represents the text to which the AutoShape is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph in the anchoring range. If this argument is omitted, the anchoring range is selected automatically and the AutoShape is positioned relative to the top and left edges of the page.

To change the type of an AutoShape that you've added, set the AutoShapeType property.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Anzeigen: