我有一个带有几个段落的word文档和每个段落之间的空行随机数。我需要修改,以便所有段落之间只有一条空行我知道我想出了什么但它不起作用
using Microsoft.Office.Interop.Word;
namespace DataToPDF
{
public class ParagraphLine
{
public static void RemoveLine()
{
object path = @"C:\Users\Desktop\Hey.docx";
Application wordApp = new Application();
object missing = System.Type.Missing;
Document doc = wordApp.Documents.Open(ref path, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing);
doc.Paragraphs.LineUnitAfter = 1;
}
}
}