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

Free Support Forum - aspose.com

Autofit Table not working

Hi,

I am unable to get the following code (from the documentation section) to work:

// Open the document
Document doc = new Document(dataDir + “TestFile.doc”);

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

// Auto fit the table to the cell contents
table.AutoFit(AutoFitBehavior.AutoFitToContents);

// Save the document to disk.
doc.Save(dataDir + “TestFile.AutoFitToContents Out.doc”);


The error is that “Table does not contain a definition for AutoFit”.

I’m thinking this could be a new feature missing from my version?
In which version did this feature come out in?

Thanks for your assistance.



Hi Dan,


Thanks for your inquiry.

You are using an old version of Aspose.Words. Please note that every new release of Aspose.Words comes up with some new features, enhancements in the existing features and bug fixes. We always encourage our customers to use the latest version of Aspose.Words as it contains newly introduced features, enhancements and fixes to the issues that are reported earlier.

I would suggest you please upgrade to the latest version (v13.6.0) from here:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry478555.aspx

Hi,

Yes I thought that may be the case.
Please can you advise which is the earliest version that contains this feature?

Many Thanks

Hi Dan,


Thanks for your inquiry. This feature was introduced in Aspose.Words for .NET 10.5.0. I would suggest you please upgrade to the latest version (v13.6.0) from here:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry478555.aspx

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.