Free Support Forum - aspose.com

Creating a simple Table in Word

Hi, I'm new in aspose.word, so I have some starting problems with it.

I just want to insert a Table with a few columns and rows into a word document, which I save as .pdf file.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveToDocumentStart();

Aspose.Words.Tables.Table table = new Aspose.Words.Tables.Table(doc);

builder.CurrentParagraph.AppendChild(table);

At this point I get the Exeption "Cannot insert a node of this type at this location"

Unfortunately I have no idea where the problem could be...

thx,

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Please follow the link to learn how to insert a table into the document

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/inserting-document-elements.html

Also, please use the following code to convert your document to PDF

Document doc = new Document(@"Test009\in.doc");

doc.SaveToPdf(@"Test009\out.pdf");

Best regards,