Free Support Forum - aspose.com

Using Table Formulas in VB.NET

Can you point me to an VB.NET example link of how to insert a simple table formula, such as

{=SUM(ABOVE)}

into a table cell? Thanks!

Formula fields insertion is not supported yet. I have logged this feature request to our defect base as Issue #940. We will try to add this feature in one of our future versions.

Best Regards,

It is now possible to insert formula fields using DocumentBuilder.

For example:

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertCell();

builder.Write("1");

builder.EndRow();

builder.InsertCell();

builder.Write("2");

builder.EndRow();

builder.InsertCell();

builder.InsertField(" =SUM(ABOVE) ", "");

builder.EndRow();

string filename = Application.StartupPath + @"\testSumAbove.doc";

doc.Save(filename);

However, although you can insert a formula, Aspose.Words will not calculate the result.

To see the result in Microsoft Word you need to press Ctrl+A and then F9.