Opening a Dot File with OpenXML

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

When I open the DOT file, I get "The document file is damaged."

Is it possible to work with a DOT file using OpenXML.

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

+1
c # openxml
source share
1 answer

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

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

+1
source share

All Articles