Get Started
Documentation

GetParentParagraph

GetParentParagraph() → { ApiParagraph }

Gets the parent paragraph that contains the graphic object.

Returns:

Type
ApiParagraph

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oFill = Api.CreateSolidFill(Api.CreateRGBColor(104, 155, 104));
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oDrawing = Api.CreateShape("rect", 3212465, 963295, oFill, oStroke);
oParagraph.AddDrawing(oDrawing);
oParentParagraph = oDrawing.GetParentParagraph();
oParentParagraph.AddLineBreak();
oParentParagraph.AddText("This is a parent paragraph");
builder.SaveFile("docx", "GetParentParagraph.docx");
builder.CloseFile();