the following snippet works fine until 11.11.8:
- Code: Select all
var document = new Document("MyTestDocument.docx");
document.Replace(pattern: "{(?i)\[\[Event_Date.*\]\]}", replace: "02/05/2024");
But it fails from 11.12.2 (and all newer versions including 12.2.11): System.NullReferenceException when executing document.Replace().
For testing:
Create an empty Word document, type "[[Event_Date]]" and save the file as "MyTestDocument.docx". The run the code above.
In 11.11.8, the placeholder [[Event_Date]] is replaced by "02/05/2024". From 11.12.2 on something must have changed because the code breaks with a NullReferenceException.
Did you change somehthing on purpose or is this a bug?
Thanks
Ingmar