Problem with DocumentBuilder.MoveToMergeField Method


Problem with DocumentBuilder.MoveToMergeField Method

Aspose.Words API Reference:

Return Value:True if the merge field was found; false otherwise.

but this method always return false, even through merge field was found.


MoveToMergeField works correctly in our internal tests. Please send us the problem document and the code snippet sufficient to reproduce the error.


I've checked it one more time and found the problem.

This is part of the source code works:

bool res = builder.MoveToMergeField("MyHeader");

But if i wrote this way:


it will not work.


Please mind, that MoveToMergeField method actually deletes the merge field it finds. So, if you call it two times in a row it will first return true, then false.