Get Started
Usage API

GetParentContentControl

GetParentContentControl() → { ApiBlockLvlSdt | null }

Gets the content control that contains the paragraph.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiBlockLvlSdt | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oBlockLvlSdt = Api.CreateBlockLvlSdt();
oDocument.Push(oBlockLvlSdt, 0);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a paragraph added to the block text content control.");
oBlockLvlSdt.AddElement(oParagraph, 0);
oParentBlockLvlSdt = oParagraph.GetParentContentControl();
oParentBlockLvlSdt.GetRange(0, 3).SetBold(true);
builder.SaveFile("docx", "GetParentContentControl.docx");
builder.CloseFile();

Resulting document