跳到主要内容

Copy

Creates a copy of the current run.

Syntax

expression.Copy();

expression - A variable that represents a ApiRun class.

Parameters

This method doesn't have any parameters.

Returns

ApiRun

Example

This example creates a copy of the run.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let run1 = Api.CreateRun();
run1.AddText("This is just a sample text that was copied. ");
paragraph.AddElement(run1);
let run2 = run1.Copy();
paragraph.AddElement(run2);