You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a template to replace the small features generated when I i want to generate a list of text found that the paragraphs is read-only, can not directly insert a new paragraph, may I ask what method can be achieved in the existing docx to insert a new paragraph, or is it that I am not using the right way!
privatestaticvoidReplaceList(XWPFDocumentdoc,IReadOnlyDictionary<string,object>data){//一定要在 普通文本替换和表格处理之后foreach(var p in doc.Paragraphs){varli= GetListInfo(p, data);if(li.IsList){varpc= li.PTemp;for(vari=0;i< li.Data.Count;i++){varpt= p.Copy();
doc.Paragraphs.Insert(p.Document.Paragraphs.IndexOf(pc)+1, pt);pc= li.IsDict ? ReplaceParagraph(pt,(Dictionary<string,object>)li.Data[i]): ReplaceParagraph(pt, li.Data[i]);}//删除模板行//doc.Paragraphs.Remove(li.PTemp);}else{}}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I made a template to replace the small features generated when I i want to generate a list of text found that the paragraphs is read-only, can not directly insert a new paragraph, may I ask what method can be achieved in the existing docx to insert a new paragraph, or is it that I am not using the right way!
Beta Was this translation helpful? Give feedback.
All reactions