void IFieldMergingCallback.FieldMerging(FieldMergingArgs e)
{
if (e.DocumentFieldName == "Document_1")
{
// Use document builder to navigate to the merge field with the specified name.
DocumentBuilder builder = new DocumentBuilder(e.Document);
builder.MoveToMergeField(e.DocumentFieldName);
// The name of the document to load and insert is stored in the field value.
Document subDoc = new Document((string)e.FieldValue);
// Insert the document.
InsertDocument(builder.CurrentParagraph, subDoc);
// The paragraph that contained the merge field might be empty now and you probably want to delete it.
if (!builder.CurrentParagraph.HasChildNodes)
builder.CurrentParagraph.Remove();
// Indicate to the mail merge engine that we have inserted what we wanted.
e.Text = null;
}
}