【发布时间】:2014-06-09 14:03:20
【问题描述】:
我需要获取我分配了标签值的段落的样式( COntentControl )。 现在我已经在 word 中的段落中添加了 contentControl (ie) Tag 值,我可以获取我分配了标签值的相应段落的文本,
case "DocumentFormat.OpenXml.Wordprocessing.SdtBlock":
SdtBlock p1 = (SdtBlock)DocElement;
string content1 = p1.InnerText;
if (!string.IsNullOrEmpty(content1))
dt.Rows.Add(content1);
break;
我正在将该 para 添加到表格中,但我需要获取 para 的样式,当我以 XML 格式保存 word 文档时,我得到了这些代码
<w:sdtContent>
<w:p w:rsidR="00D57D79" w:rsidRDefault="00176023">
<w:pPr>
<w:pStyle w:val="Heading1"/>
<w:rPr>
<w:rFonts w:eastAsia="Times New Roman"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:lang w:val="en-US"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:eastAsia="Times New Roman"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>Use Case Model</w:t>
</w:r>
</w:p>
</w:sdtContent>
</w:sdt>
我需要获取那个段落对应的样式。如何获取那些样式?
【问题讨论】:
标签: xml vba ms-word ms-office office-interop