我想应用一些在单词中预定义的样式。我的代码如下,但是样式“ Heading1”不起作用。
WordprocessingDocument wordprocessingDocument = WordprocessingDocument.Open(document, true);
Body body = wordprocessingDocument.MainDocumentPart.Document.Body;
Paragraph p = new Paragraph();
ParagraphProperties ppr = new ParagraphProperties();
ParagraphStyleId stid = new ParagraphStyleId() { Val = "Heading1" };
ppr.Append(stid);
p.Append(ppr);