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

Free Support Forum - aspose.com

If conditions are not interpreted correctly with UpdateFields


I have a document with some if statments in and have following simple code to update the fields:

private void button1_Click(object sender, EventArgs e)


Aspose.Words.Document aspDoc = new Aspose.Words.Document("C:\\Document_before_update.docx");


Aspose.Words.SaveFormat docSaveFormat = Aspose.Words.SaveFormat.Docx;

docSaveFormat = Aspose.Words.SaveFormat.Docx;

aspDoc.Save("C:\\Document_after_update.docx", docSaveFormat);


But the result "Document_after_update.docx" does not look correct.

When I open the result in Word and update the fields manually, all is shown correctly.

Can you tell me why the if statements are not updated correctly with my code?

I am using the latest aspose version 16.11

Attached you can find my docx files. Thx for your help.


Hi Christian,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14453. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Can you tell me a timeframe in which this bug will be fixed?
Hi Christian,

Thanks for your inquiry. We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. Our developers work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, your issue is pending for analysis and is in the queue. Once our product team completes the analysis of your issue, we will then be able to provide you an estimate.

Thanks for your patience and understanding.
Hi Christian,

Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-14453) as 'Not a Bug'.

Your document contains several nested IF fields with content control. The result of the topmost IF field is combination of SDT (content control). In addition, sample document contains the DATE field at the beginning.

Aspose.Words updates IF fields with success. But, when MS Word opens the output document it updates the DATE field and this leads to invalidate SDT content in the IF field result for a unclear reason.

It seems that it is a MS Word bug. It is very easy to reproduce problem with MS Word:

  • Open sample document.
  • Update fields: the result of the IF field is correct.
  • Save and close document.
  • Reopen sample document: the result of the IF field is incorrect.