ShapeBaseName Property
Gets or sets the optional shape name.

Namespace: Aspose.Words.Drawing
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
public string Name { get; set; }

Property Value

Type: String

Default is empty string.

Cannot be null, but can be an empty string.

Shows how to insert shapes.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a cube and set its name
Shape shape = builder.InsertShape(ShapeType.Cube, 150, 150);
shape.Name = "MyCube";

// We can also set the alt text like this
// This text will be found in Format AutoShape > Alt Text
shape.AlternativeText = "Alt text for MyCube.";

// Insert a text box
shape = builder.InsertShape(ShapeType.TextBox, 300, 50);
shape.Font.Name = "Times New Roman";

// Move the builder into the text box and write text
builder.Write("Hello world!");

// Move the builder out of the text box back into the main document

// Insert a shape with an image
shape = builder.InsertImage(Image.FromFile(ImageDir + "Aspose.Words.gif"));

// Rotate the image
shape.Rotation = 45.0;

doc.Save(ArtifactsDir + "Shape.InsertShapes.docx");
See Also