Opening Dot File with OpenXML

安稳与你 提交于 2019-12-24 08:47:42

问题


I need to work on opening a DOT (word document template) file, replace the fillers and save it as Document file.

On opening DOT file I am getting "Document File is Corrupted".

Is it possible to work with DOT file using OpenXML.

UPDATE: I am saving DOT file as XML (manually using "Save as.."). Renaming file back to dot, so it is XML file built on WordML. Still trying to open it through OpenXML giving me the same error.


回答1:


OpenXML is used in the new formats of Office 2007 (.dotx and .docx). WordML is a bit older and cannot be used with the OpenXML libraries.

You can load a WordML file as an XmlDocument or load it into a string if you know exactly what data you want to replace.



来源:https://stackoverflow.com/questions/3014792/opening-dot-file-with-openxml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!