Hey,
I noticed issue with smart quotes in if statement.
In Word the smart quotes are taken like straight quotes and if the value inside matches, then it returns true. But in my case, the value inside quotes don’t match, because there’s difference in quote marks.
var documentPath = @"D:\MyRepos\SmartQuoteInIfStatement\files\testfile.dotx";
var document = new Document(documentPath);
document.UpdateFields();
foreach (Field field in document.Range.Fields.ToArray())
{
var ifField = field as FieldIf;
if (ifField != null)
{
Console.WriteLine(field.Result);
field.Unlink();
}
}
Console.WriteLine("click any key to close");
Console.ReadKey();
testfile.zip (13.1 KB)
Could you check, please?
Thanks,
Mateusz