# Canvas Shape

Add canvas shape to your documents to organize multiple drawing objects in DsWord.

## Content

A canvas shape acts as a container for multiple drawing objects and can be used to organize them all at once.
DsWord allows you to draw a canvas shape and add multiple drawing objects to it. A canvas shape can be added by using [Add](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.CanvasShapeCollection.Add.html) and [Insert](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.CanvasShapeCollection.Insert.html) methods of [CanvasShapeCollection](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.CanvasShapeCollection.html) class. You can also access the previous or next canvas shapes and apply fill format or line format properties on them by using various methods provided by [CanvasShape](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.CanvasShape.html) class.

## Add Canvas Shape

To add canvas shape in a document:

1. Create a new Word document by instantiating **GcWordDocument** class.
2. Add a run to a newly added paragraph by using **Add** method of RunCollection class.
3. Add a canvas shape by using **Add** method of **CanvasShapeCollection** class.
4. Add two shapes inside canvas shape by using [Add](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.ShapeCollection.Add.html) method of [ShapeCollection](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.ShapeCollection.html) class.
5. Move the horizontal and vertical position of second shape by using [Offset](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.ShapeHorizontalPosition.Offset.html) property of [ShapeHorizontalPosition](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.ShapeHorizontalPosition.html) class so that it does not overlap the first shape.

    ```csharp
    var doc = new GcWordDocument();
    
    //Add Run element       
    var run = doc.Body.Paragraphs.Add().GetRange().Runs.Add();
    
    //Create canvas shape with initial width 500 and height 500
    var canvas_shape = run.GetRange().CanvasShapes.Add(500, 500);
    
    //Create two shapes inside canvas shape
    var firstShape = canvas_shape.GetRange().Shapes.Add(202, 250, "First shape");
    var secondshape = canvas_shape.GetRange().Shapes.Add(300, 400, "Second shape");
    
    //Move second shape 100 points right and 100 points lower
    secondshape.Position.Horizontal.Offset = 100;
    secondshape.Position.Vertical.Offset = 100;
    
    //Save document
    doc.Save("CanvasShape.docx");
    ```

## Delete Canvas Shape

To delete canvas shape in a document:

1. Load the document containing canvas shape using **Load** method of **GcWordDocument** class.
2. Delete the canvas shape by using **Delete** method of ContentObject class.

    ```csharp
    //Load document
    doc.Load("CanvasShape.docx");
    
    //Access first canvas
    CanvasShape cs = doc.Body.CanvasShapes.First;
    //Delete canvas
    cs.Delete();
    
    doc.Save("CanvasDelete.docx");
    ```


**Limitations**

* Unsupported Properties: NonVisualGroupDrawingShapePropsExtensionList, GroupShapeLocks, OfficeArtExtensionList, Scene3DType, ShapePropertiesExtensionList
* Unsupported Effects and derived classes: EffectsDAG,EffectsList, WholeFormattingEffectList, WholeFormattingEffectDag