Push
Push a paragraph or a table to actually add it to the document.
Parameters:
Name |
Type |
Description |
oElement |
DocumentElement
|
The type of the element which will be pushed to the document. |
Returns:
-
This method doesn't return any data.
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph0 = oDocument.GetElement(0);
oParagraph0.AddText("This is paragraph #0, you must not push it to take effect.");
for (nParaIncrease = 0; nParaIncrease < 5; ++nParaIncrease) {
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is paragraph #" + (nParaIncrease + 1) + ", you must push it to take effect.");
oDocument.Push(oParagraph);
}
builder.SaveFile("docx", "Push.docx");
builder.CloseFile();
Resulting document