GetContent

GetContent() → { ApiDocumentContent }

Returns the content of the current container.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiDocumentContent

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oBlockLvlSdt = Api.CreateBlockLvlSdt();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a block text content control.");
oBlockLvlSdt.AddElement(oParagraph, 0);
oDocument.AddElement(0, oBlockLvlSdt);
oBlockLvlSdt.GetContent().GetElement(1).AddText("This is a content of the container.");
builder.SaveFile("docx", "GetContent.docx");
builder.CloseFile();

Resulting document