views:

33

answers:

1

Hi,

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  A: 

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.

ZippyV