public TestCase Parse(string filepath, int testcaseId) { /* * Load doc * Get the table * Get the row and get the description and expected result * Generate height per WordParagraph for Description * Attempt to join the Description and Expected */ var doc = ap.Documents.Open(filepath); this.doc = doc; Thread.Sleep(500); // Word needs to load the document and there is no way of doing a waitfor. var testcase = new TestCase { Id = testcaseId }; Globals.Log("Total word paragraphs found : " + doc.Paragraphs.Count); var tables = doc.Tables.Cast <Table>().ToList(); var allParagraphs = doc.Paragraphs.Cast <Paragraph>().ToList(); testcase.AddTitle(allParagraphs); testcase.AddDescription(allParagraphs); testcase.AddTestSteps(tables); doc.Close(); return(testcase); }