我替換模板的方法是用AddCustomProperty方法,但是這樣\n在word里會變成空格,除此之外我也試過了 把\n替換成\r\n、<br>、^p、Environment.NewLine等等,但是都沒用。代碼如下↓:
DocX document = DocX.Load(filePath);
document.AddCustomProperty(new CustomProperty("BLNo", “aaaaaaaaaaaaa\naaaaaaa”));
document.AddCustomProperty(new CustomProperty("NotifyParty", “問起我i介紹的幾款\n薩達拉薩看得見”));
↑請給位大佬們幫幫忙!是不是DocX就是不能換行啊?
uj5u.com熱心網友回復:
???都沒有人嗎?uj5u.com熱心網友回復:
遇到了同樣問題..我用poi生成.docx檔案..里面也是用的\r換行.下載之后用wps打開顯示正常,可以換行..
但是用office卻不行,成一坨了,不自動換行..
啊啊啊,office吃屎了啊
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/155153.html
標籤:ASP.NET
上一篇:C# 條碼識別
