Skip to main content

GetDocContent

Returns the shape inner contents where a paragraph or text runs can be inserted.

Syntax

expression.GetDocContent();

expression - A variable that represents a ApiShape class.

Parameters

This method doesn't have any parameters.

Returns

ApiDocumentContent

Example

Retrieve the inner writing area of a shape as a content container in a document.

// How do I obtain the document-level content block held inside a shape in a document?

// Write into a shape by gaining access to its document content region in a document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let drawing = Api.CreateShape("rect", 3212465, 963295, fill, stroke);
paragraph.AddDrawing(drawing);
let docContent = drawing.GetDocContent();
let classType = drawing.GetClassType();
paragraph = Api.CreateParagraph();
paragraph.AddText("Class Type = " + classType);
docContent.AddElement(0, paragraph);