Issue with FieldRef expressions with conditionals

Hello,

We had found a problem using the ASPOSE.Words for JAVA.

We have documents with FieldRef that are replaced with text on executing time. Some of these FieldRef have expressions with conditionals.

As you can see in the document:

Our program has the variable FCPPO_CONCLUS. Microsoft Word writes “Favorable” if the variable has the value “favorable”.

We have more complex expressions:

I need to execute those expressions with ASPOSE.

Is there a way to execute it in a similar (or equivalent) “Microsoft Word” way.

Noe, with ASPOSE Words we have no problem replacing the FieldRef with no expressions:

Can you help us with this use case case. This is the last problem with ASPOSE library.

SDE_DOCUM_____SDE_EXPED_____CINTCINTIPMO_CINTIPMO.zip (20.8 KB)

See you soon.
Regards,
Xevi Serrats


This Topic is created by alexey.butalov using Email to Topic tool.

@asposeaudifilm REF field gets their values from bookmarks. So the bookmarks with the specified names should be present in the document. For example see the following code:

Document doc = new Document(@"C:\Temp\in.dot");
DocumentBuilder builder = new DocumentBuilder(doc);

if (doc.Range.Bookmarks["FCPPO_CONCLUS"] == null)
{
    builder.MoveToDocumentEnd();
    builder.StartBookmark("FCPPO_CONCLUS");
    builder.EndBookmark("FCPPO_CONCLUS");
}

doc.Range.Bookmarks["FCPPO_CONCLUS"].Text = "favorableExcep";
doc.UpdateFields();

doc.Save(@"C:\Temp\out.docx");