c# - Validate a Word 2007 Template file -
I am developing a solution that allows people to upload a DOCX file as a template. This template is used to create Word documents with databases documents
What to do once I get a template upload, to check it for errors. (I do not want the template to be used when my parser is crashing.)
I have seen a question about a word template, but it is not enough to validate the integrity of the file. Of course, opening the file, validating XML there, and doing the same thing is possible, but this is the CPU's intensity and if I want a different perspective.
Is there any solution that is part of Open XML SDK or other standard methods? Any thoughts are apreciated.
in C # close
public static Bool isDocumentValid (word processing document) Mydoc) {OpenXmlValidator verifier = new openexvalidator (); Var Errors = Verifier Validity (mydoc); Foreach Debugging Errors Error (Validation Error in Error). Write (error description); Return (errors.Count () == 0); }
Comments
Post a Comment