Get Started
Usage API
More information

GetPrevShape

GetPrevShape() → { ApiShape | null }

Get the previous inline shape.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiShape | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oGs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 224, 204), 0);
oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 164, 101), 100000);
oFill = Api.CreateLinearGradientFill([oGs1, oGs2], 5400000);
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oShape1 = Api.CreateShape("rect", 3212465, 963295, oFill, oStroke);
oParagraph.AddDrawing(oShape1);
oShape2 = Api.CreateShape("wave", 3212465, 963295, oFill, oStroke);
oParagraph.AddDrawing(oShape2);
oPrevShape = oShape2.GetPrevShape();
oFill = Api.CreateSolidFill(Api.CreateRGBColor(61, 74, 107));
oPrevShape.Fill(oFill);
builder.SaveFile("docx", "GetPrevShape.docx");
builder.CloseFile();

Resulting document