openxml中 加入<w:br /> 就行请看代码想办法把这个插进去
<w:p w:rsidRPr="00CF4A05" w:rsidR="00FD48A2" w:rsidP="00CF4A05" w:rsidRDefault="00A03D24" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:r w:rsidRPr="00CF4A05">
<w:t> 1:This is the first line</w:t>
</w:r>
<w:r w:rsidRPr="00CF4A05">
<w:br />
<w:t>2:This is the second line</w:t>
</w:r>
</w:p>OpenXmlElement parantElement = sdtElement.Descendants<Paragraph>().SingleOrDefault();
parantElement.InnerXml = @"<w:r w:rsidRPr=""004E02CB"">
<w:t>This is the first line</w:t>
</w:r>
<w:r w:rsidRPr=""004E02CB"">
<w:br />
<w:t>This is the second line</w:t>
</w:r>";
这里插入即可
<w:p w:rsidRPr="00CF4A05" w:rsidR="00FD48A2" w:rsidP="00CF4A05" w:rsidRDefault="00A03D24" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:r w:rsidRPr="00CF4A05">
<w:t> 1:This is the first line</w:t>
</w:r>
<w:r w:rsidRPr="00CF4A05">
<w:br />
<w:t>2:This is the second line</w:t>
</w:r>
</w:p>OpenXmlElement parantElement = sdtElement.Descendants<Paragraph>().SingleOrDefault();
parantElement.InnerXml = @"<w:r w:rsidRPr=""004E02CB"">
<w:t>This is the first line</w:t>
</w:r>
<w:r w:rsidRPr=""004E02CB"">
<w:br />
<w:t>This is the second line</w:t>
</w:r>";
这里插入即可
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货