简体   繁体   English

将Word 2010中的丰富内容控件的内容转换为html格式

[英]Convert contents of a rich content control in word 2010 to html format

Is there any way to convert the contents (along with the formatting and embedded images) of a rich contentControl in word 2010 to HTML. 有什么方法可以将Word 2010中丰富的contentControl的内容(以及格式和嵌入的图像)转换为HTML。 The contentControl.Range.WordOpenXml property returns a XML in the openXml format. contentControl.Range.WordOpenXml属性返回openXml格式的XML。 However this XML is not a full fledged openXml document mark-up and just a part of it. 但是,此XML并不是完整的openXml文档标记,而只是一部分。 This denies the possibility of using any HTMLConverter libraries for OpenXML to HTML to be used. 这拒绝了使用任何HTMLConverter库将OpenXML转换为HTML的可能性。 I gave it a try with Power Tools for Open XML by EricWhiteDpe but the markup cannot be even loaded in a WordprocessingDocument object. 我使用EricWhiteDpe的Power Tools for Open XML进行了尝试,但是标记甚至无法加载到WordprocessingDocument对象中。 (Error : Corrupt data) What else could be my options? (错误:数据损坏)我还有什么选择?

I'm not sure if this will work, but the idea I have is - try creating a new document and add the contents of the contentControl.Range.WordOpenXml to the new document, then save it. 我不确定这是否行得通,但是我的想法是-尝试创建一个新文档,然后将contentControl.Range.WordOpenXml的内容添加到新文档中,然后保存它。 You could then take this new document's Open Office XML and covert it to HTML using the tools you mentioned. 然后,您可以使用该新文档的Open Office XML,并使用上述工具将其转换为HTML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM