How to render Shape inside the Aspose document

Hi,
My main objective is to add ‘Shape’ object inside the Aspose document.
Currently we are using VBA macro to render Shape object (which is a line) in each individual pages.
I have read the following article, but it seems not relevant to me.
https://docs.aspose.com/words/net/working-with-graphic-elements/
May i know is it possible to render ‘Shape’ object inside Aspose document ? Is there any code snippet for this ?
Regards,
hadi teo

Hi Hadi,

Thanks for your inquiry. Please use the following code snippets for your requirements and read Shape Types from following documentation link:
https://reference.aspose.com/words/net/aspose.words.drawing/shapetype/

The Shape Class represents an object in the drawing layer, such as an AutoShape, textbox, freeform, OLE object, ActiveX control, or picture. Using the Shape class you can create or modify shapes in a Microsoft Word document.

// Create document
Document doc = new Document();
// Create DocumentBuilder
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert some text
builder.Write("This is text before shape");
// Create elipse shape
Shape elipse = new Shape(doc, ShapeType.Ellipse);
// Set size of shape
elipse.Width = 120;
elipse.Height = 100;
// Set WrapType
elipse.WrapType = WrapType.Inline;
// Insert shape into the document
builder.InsertNode(elipse);
// Insert some text
builder.Write("Some text sfter shape");
// Save document
doc.Save(@"Test057\out.doc");

==============================================================

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Create Line Shape
Shape line = new Shape(doc, ShapeType.Line);
// Specify width of the shape.
line.Width = 100;
// Set line width.
line.Stroke.Weight = 5;
// Insert shape into the document
builder.InsertNode(line);
// Save document
doc.Save(MyDir + @"out.doc");