MailMerge/UpdateField/Formula (negative value)

Hi
I have a document where I use “MailMerge.Execute” and expects the formula fields to be calculated correctly.

However, when the document contains a negative number, the calculation returns 0

I have read that the MailMerge.Execute automatically updates the formula fields, but for the sake of the example I have provided some attachments and test code which uses the “UpdateFields” method.

Dim sti = “C:\Test\Test1.docx”
Dim doc = New Document(sti)
doc.UpdateFields()

Dim nySti = “C:\Test\Test_” + Guid.NewGuid().ToString() + “.docx”
doc.Save(nySti, Aspose.Words.SaveFormat.Docx)

Dim sti2 = “C:\Test\Test2.docx”
Dim doc2 = New Document(sti2)
doc2.UpdateFields()

Dim nySti2 = “C:\Test\Test2_” + Guid.NewGuid().ToString() + “.docx”
doc2.Save(nySti2, Aspose.Words.SaveFormat.Docx)

“Test1.docx” contains a negative number and the formula returns 0 when using the “UpdateFields”.

“Test2.docx” does not, and returns a correctly calculated number when using the "UpdateFields"

When I open eg. Test_d0821118-f67e-4e59-9ea2-b4804ca9e25b.docx (the file which is generated by the above code) and manually right click on the formula field and press “Update field”, the field is calculated correctly.

How can I fix this?
Hope you can help :slight_smile:


Hi Thomas,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 16.4.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The IDs of these issues are WORDSNET-13693 (test1.docx) and WORDSNET-13694 (test2.docx). Your thread has also been linked to the appropriate issues and you will be notified as soon as they are resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-13693;WORDSNET-13694) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.