Document.Shapes Property (2007 System)
Gets a Shapes collection that represents all the Shape objects in the document.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Shapes As Shapes
'Usage
Dim instance As Document
Dim value As Shapes
value = instance.Shapes
[BrowsableAttribute(false)]
public Shapes Shapes { get; }
[BrowsableAttribute(false)]
public:
property Shapes^ Shapes {
Shapes^ get ();
}
public function get Shapes () : Shapes
Property Value
Type: Shapes
A Shapes collection that represents all the Shape objects in the document.
Remarks
This collection can contain drawings, shapes, pictures, OLE objects, ActiveX controls, text objects, and callouts.
The Shapes property, when applied to a document, returns all the Shape objects in the main story of the document, excluding the headers and footers. When applied to a HeaderFooter object, the Shapes property returns all the Shape objects found in all the headers and footers in the document.
Examples
The following code example adds a shape to the upper left-hand corner of the document.
This example is for a document-level customization.
Private Sub DocumentShapes()
Me.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation. _
msoTextOrientationVertical, 10, 10, 50, 50)
End Sub
private void DocumentShapes()
{
this.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationVertical,
10, 10, 50, 50, ref missing);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.