Hello,
i want to move my DocumentBuilder to a specific MergeField in the document ro wirte with ListFormat at this position. Is there any posible way to search for this MergeField, using just its name?
And then use DocumentBuilder.MoveToField() to get to this MergeField, delete it and write my list.
I tried this:
DocumentBuilder.MoveToField(Document.GetChild(“FieldName”, true));
but the MoveToField Method does not support Strings as first parameter.
Greetings,
Crazkur
Edit:
i found a way, which is closer to working than my first try
Collection<Node> tmp = new Collection<Node>(Document.GetChildNodes(NodeType.Any, true).ToArray());var node = tmp.First(n => n.GetText().Contains(fieldName));
_builder.MoveTo(node);
this throws me an System.InvalidOperationException at the Builder.MoveTo(node)
Additional information: The node must be a block or an inline.