We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Add Text Column in Section of Word Document C# .NET - Create Text Columns in Section using Document Builder

Hi,
I’m evaluating Aspose.Word for our project which generate reports/documents for end users.

I have a business case where I have a page in my document which has divided into 2 columns.
I need to fill each column with headings and list items.

Please note that this document has paragrhaps, tables etc.
So I start creating the document with

        var doc = new Document();
        doc.RemoveAllChildren();
        var section = new Section(doc);
        doc.AppendChild(section);
        

        var body = new Body(doc);
        section.AppendChild(body);
        .....

Can introduce Columns the doc object without using DocumentBuilder?
Also, is it good practice to use DocumentBuilder some part of the document construction and then stick back to Document object?

Appreciate your prompt reply regarding inserting columns without DocumentBuilder or any recomanded way of introducing columns into the document with list items within columns.

Regards,
Ranga Fernando

@ranga.fernando,

I am afraid, the TextColumn Class does not have any constructor(s); so you will not be able to initialize a new instance of the TextColumn Class. Please refer to following page for more details:

Secondly, yes you can use DocumentBuilder or DOM (document object model) classes or both to insert/modify different document elements in document.

Hi @awais.hafeez,

I had a look at the
TextColumn Class

I saw the sample written there to demonstrate the usage of the TextColoumn.

However, my use case is as follows:

— some text on the page
— introduce 2 columns
Within the columns I need text with list items.

Like in the attached image.document.PNG (23.7 KB)

Appreciate your prompt support in this regard.

Regards,
Ranga

@ranga.fernando,

Please also ZIP and attach your expected Word document (DOCX file) showing the desired output here for our reference. You can create expected document by using MS Word. We will then investigate the layout of your expected document and provide you code to achieve the same by using Aspose.Words. Thanks for your cooperation.