This project has moved. For the latest updates, please go here.
1
Vote

Error: ArgumentNullException

description

This is my code:

{
using (WordprocessingDocument document = WordprocessingDocument.Create(filepath, WordprocessingDocumentType.Document))
        {
            MainDocumentPart mainPart = document.AddMainDocumentPart();
            mainPart.Document = new Document();

            HtmlConverter converter = new HtmlConverter(mainPart);
            converter.Parse(
                            "< html >" +
                                 "< head >" +
                                      "< title ></ title >" +
                                 "</ head >" +
                                 "< body >" +
                                      "Looks how cool is < font size = 'x-large' >< b > Open Xml </ b ></ font >." +
                                      "Now with < font color = 'red' >< u > HtmlToOpenXml </ u ></ font >, it nevers been so easy to convert html." +
                                      "< p >" +
                                           "If you like it, add me a rating on < a href = 'http://notesforhtml2openxml.codeplex.com' > codeplex </ a >" +
                                      "</ p >" +
                                      "< hr >" +
                                 "</ body >" +
                            "</ html > ");
             }
}
I'm passing in an actual html string. How come I get
"Exception Details: System.ArgumentNullException: Value cannot be null."

comments