Get Started
Usage API
More information

GetParentParagraph

GetParentParagraph() → { ApiBlockLvlSdt | null }

Returns a paragraph that contains the current content control.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiBlockLvlSdt | null

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a parent paragraph. ");
var oInlineLvlSdt = Api.CreateInlineLvlSdt();
oInlineLvlSdt.AddText("This is an inline text content control added to the paragraph.");
oParagraph.AddInlineLvlSdt(oInlineLvlSdt);
var oParentParagraph = oInlineLvlSdt.GetParentParagraph();
oParentParagraph.SetBold(true);
builder.SaveFile("docx", "GetParentParagraph.docx");
builder.CloseFile();

Resulting document