Free Support Forum - aspose.com

Columns Is Not Showing in word Document

I just Generate word document with 12 columns… But it shows only 8 columns… Rest of the columns has no space to print… How can i fix Maximum width to word document…?

I just Generate word document with 12 columns.. But it shows only 8 columns.. Rest of the columns has no space to print.. How can i fix Maximum width to word document....?

Hi there,


Thanks for your inquiry. Please use PageSetup.PageWidth property to set the width of the page in points. The page’s width should be same or greater than columns’ width.

You may use Table.AutoFit method with value AutoFitToWindow. This will set the preferred width for the table to 100%, removes preferred widths from all cells and then updates the table layout.

If you still face problem, please share your input, output and expected output document along with code example to reproduce this issue at our end. We will then provide you more information about your query.

// Open the document<o:p></o:p>

Document doc = new Document(dataDir + "TestFile.doc");

Table table = (Table)doc.GetChild(NodeType.Table, 0, true);

// Disable autofitting on this table.

table.AutoFit(AutoFitBehavior.AutoFitToWindow);

// Save the document to disk.

doc.Save(dataDir + "TestFile.FixedWidth Out.doc");

Its throw the error…

“Formatting cannot be applied because the table is empty”
Hi there,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we'll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.