[英]How to apply styles in word while inserting WordMl in VSTO?
我已經制作了一個WordMl包,並使用“ Range.InsertXML”方法插入,但是word正在刪除插入段落的樣式。
如何保存從Wordml插入的樣式?
下面是WordMl程序包。
<?xml version="1.0" encoding="UTF-8"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
<pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml">
<pkg:xmlData>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:body>
<w:p xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2" wsp:rsidR="" wsp:rsidRPr="" wsp:rsidRDefault="">
1537339367146
<w:r wsp:rsidRPr="">
<w:rPr>
<w:color w:val="" />
<w:sz w:val="20" />
</w:rPr>
<w:t xml:space="preserve"> Corey M Abramson, Elena Portacolone </w:t>
</w:r>
<w:r>
<w:rPr>
<w:sz w:val="20" />
<w:rStyle w:val="sup" />
</w:rPr>
<w:t xml:space="preserve"> ( 2017 ) </w:t>
</w:r>
<w:r wsp:rsidRPr="">
<w:rPr>
<w:color w:val="" />
<w:sz w:val="20" />
</w:rPr>
<w:t xml:space="preserve"> What is new with old? What old age teaches us about inequality and stratification. </w:t>
</w:r>
</w:p>
</w:body>
</w:document>
</pkg:xmlData>
</pkg:part>
</pkg:package>
我已經通過在ooxml中添加樣式pkg解決了這個問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.