public InsertText ( int index, string value, bool trackChanges = false, |
||
index | int | The index position of the insertion. |
value | string | The System.String to insert. |
trackChanges | bool | Flag this insert as a change. |
formatting | The text formatting. | |
return | void |
public virtual Paragraph InsertParagraph(int index, string text, bool trackChanges, Formatting formatting) { Paragraph newParagraph = new Paragraph(Document, new XElement(DocX.w + "p"), index); newParagraph.InsertText(0, text, trackChanges, formatting); Paragraph firstPar = HelperFunctions.GetFirstParagraphEffectedByInsert(Document, index); if (firstPar != null) { XElement[] splitParagraph = HelperFunctions.SplitParagraph(firstPar, index - firstPar.startIndex); firstPar.Xml.ReplaceWith ( splitParagraph[0], newParagraph.Xml, splitParagraph[1] ); } else Xml.Add(newParagraph); GetParent(newParagraph); return newParagraph; }