小编OZn*_*new的帖子

无法使用OpenXml为单词添加项目符号

我的预期结果是:

  • 你好
  • 世界!

但当我使用以下代码时:

        MainDocumentPart mainDocumentPart =
          package.AddMainDocumentPart();

        DocumentFormat.OpenXml.Wordprocessing.Document elementW =
          new DocumentFormat.OpenXml.Wordprocessing.Document(
            new Body(
              new DocumentFormat.OpenXml.Wordprocessing.Paragraph(
                    new NumberingProperties(
                      new NumberingLevelReference() { Val = 0 },
                      new NumberingId() { Val = 1 })
                    ),
                new Run(
                  new RunProperties(),
                  new Text("Hello, ") { Space = new DocumentFormat.OpenXml.EnumValue<DocumentFormat.OpenXml.SpaceProcessingModeValues> { InnerText = "preserve" } })),
              new DocumentFormat.OpenXml.Wordprocessing.Paragraph(
                new ParagraphProperties(
                  new NumberingProperties(
                    new NumberingLevelReference() { Val = 0 },
                    new NumberingId() { Val = 1 })),
                new Run(
                  new RunProperties(),
                  new Text("world!")
                  {
                      Space …
Run Code Online (Sandbox Code Playgroud)

docx openxml openxml-sdk

3
推荐指数
1
解决办法
4004
查看次数

标签 统计

docx ×1

openxml ×1

openxml-sdk ×1