C# 如何在开放XML中使项目符号变大?

C# 如何在开放XML中使项目符号变大?,c#,openxml,docx,openxml-sdk,openxml-powertools,C#,Openxml,Docx,Openxml Sdk,Openxml Powertools,我正在使用.NET的OpenXMLSDK生成docx文件 我名单上的子弹非常小,但我不知道为什么。下面是我所做的: 生成带有单个项目符号项的文档 从Word创建了一个带有单个项目符号的文档 使用开放式XML生产力工具来比较这两个文件 我看不出有什么不同 如果我点击两个项目符号,它显示的字体和大小,他们都是相同的!我看不出xml的编号部分有任何区别,或者在任何地方都没有区别。也许我遗漏了一些基本的东西 以下是编号部分的一些代码: 下面是大项目符号的XML: <?xml version="

我正在使用.NET的OpenXMLSDK生成docx文件

我名单上的子弹非常小,但我不知道为什么。下面是我所做的:

生成带有单个项目符号项的文档 从Word创建了一个带有单个项目符号的文档 使用开放式XML生产力工具来比较这两个文件 我看不出有什么不同 如果我点击两个项目符号,它显示的字体和大小,他们都是相同的!我看不出xml的编号部分有任何区别,或者在任何地方都没有区别。也许我遗漏了一些基本的东西

以下是编号部分的一些代码:

下面是大项目符号的XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14">
 <w:body>
  <w:p w14:paraId="6279EAE9" w14:textId="5895C066" w:rsidR="008070A4" w:rsidRPr="009228DC" w:rsidRDefault="00281441" w:rsidP="00984CDF">
   <w:pPr>
    <w:pStyle w:val="ListParagraph"/>
    <w:numPr>
     <w:ilvl w:val="0"/>
     <w:numId w:val="5"/>
    </w:numPr>
    <w:ind w:left="0"/>
    <w:rPr>
     <w:rFonts w:cstheme="minorHAnsi"/>
    </w:rPr>
   </w:pPr>
   <w:bookmarkStart w:id="0" w:name="_GoBack"/>
   <w:bookmarkEnd w:id="0"/>
   <w:r w:rsidRPr="009228DC">
    <w:rPr>
     <w:rFonts w:cstheme="minorHAnsi"/>
    </w:rPr>
    <w:t>
     Large bullet
    </w:t>
   </w:r>
  </w:p>
  <w:sectPr w:rsidR="008070A4" w:rsidRPr="009228DC">
   <w:pgSz w:w="12240" w:h="15840"/>
   <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
   <w:cols w:space="720"/>
   <w:docGrid w:linePitch="360"/>
  </w:sectPr>
 </w:body>
</w:document>
下面是小的xml:

    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14">
 <w:body>
  <w:p w14:paraId="6279EAE9" w14:textId="4866CD41" w:rsidR="008070A4" w:rsidRPr="009228DC" w:rsidRDefault="00221689" w:rsidP="008C6B6F">
   <w:pPr>
    <w:pStyle w:val="ListParagraph"/>
    <w:numPr>
     <w:ilvl w:val="0"/>
     <w:numId w:val="1"/>
    </w:numPr>
    <w:ind w:left="0"/>
    <w:rPr>
     <w:rFonts w:cstheme="minorHAnsi"/>
    </w:rPr>
   </w:pPr>
   <w:bookmarkStart w:id="0" w:name="_GoBack"/>
   <w:bookmarkEnd w:id="0"/>
   <w:r w:rsidRPr="009228DC">
    <w:rPr>
     <w:rFonts w:cstheme="minorHAnsi"/>
    </w:rPr>
    <w:t>
     This is a bulleted list
    </w:t>
   </w:r>
  </w:p>
  <w:sectPr w:rsidR="008070A4" w:rsidRPr="009228DC">
   <w:pgSz w:w="12240" w:h="15840"/>
   <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
   <w:cols w:space="720"/>
   <w:docGrid w:linePitch="360"/>
  </w:sectPr>
 </w:body>
</w:document>

项目符号和数字的格式在w:abstractNum元素中定义,或者由NumberingDefinitionsPart的w:numbering根元素中包含的精确的子元素定义。MainDocumentPart的w:document根元素可能完全相同。但是,在您的例子中,您至少应该看到w:numId元素具有不同的w:val属性值,这意味着它们指向不同的编号实例和相关的项目符号定义


因此,您需要正确设置编号定义,然后从主文档部分引用编号定义。

在生产力工具中打开生成的文档。现在使用它的比较功能查看手动创建的Word文档。这应该会告诉您openxml这个词的区别在哪里,并生成代码从第一个创建第二个。我相信我的编号参考是正确的。要使其显示正确大小的项目符号,唯一的方法是使用选项8并将项目符号直接键入levelText,而不是%1。项目符号使用%1显示。但正如你在截图中看到的那样,它很小。我的问题已经解决了,但我不认为我应该在其中键入•正确?@user1447679,您应该使用Microsoft Word设置所需的项目符号,然后查看并模仿Word创建的开放XML标记。%1是用来编号的,不是子弹,很奇怪。因此,生成的编号部分创建了大量使用%1等的项目符号配置。但在代码堆的深处,是那些使用了%1的项目符号配置。我不知道为什么。。。这其中的一半仍然是一个黑洞,但开始掌握它的窍门-感谢你的帮助,这是!
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14">
 <w:body>
  <w:p w14:paraId="6279EAE9" w14:textId="4866CD41" w:rsidR="008070A4" w:rsidRPr="009228DC" w:rsidRDefault="00221689" w:rsidP="008C6B6F">
   <w:pPr>
    <w:pStyle w:val="ListParagraph"/>
    <w:numPr>
     <w:ilvl w:val="0"/>
     <w:numId w:val="1"/>
    </w:numPr>
    <w:ind w:left="0"/>
    <w:rPr>
     <w:rFonts w:cstheme="minorHAnsi"/>
    </w:rPr>
   </w:pPr>
   <w:bookmarkStart w:id="0" w:name="_GoBack"/>
   <w:bookmarkEnd w:id="0"/>
   <w:r w:rsidRPr="009228DC">
    <w:rPr>
     <w:rFonts w:cstheme="minorHAnsi"/>
    </w:rPr>
    <w:t>
     This is a bulleted list
    </w:t>
   </w:r>
  </w:p>
  <w:sectPr w:rsidR="008070A4" w:rsidRPr="009228DC">
   <w:pgSz w:w="12240" w:h="15840"/>
   <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
   <w:cols w:space="720"/>
   <w:docGrid w:linePitch="360"/>
  </w:sectPr>
 </w:body>
</w:document>