public static void Run()
{
// ExStart:InsertField
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_WorkingWithFields();
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertField(@"MERGEFIELD MyFieldName \* MERGEFORMAT");
dataDir = dataDir + "InsertField_out.docx";
doc.Save(dataDir);
// ExEnd:InsertField
Console.WriteLine("\nInserted field in the document successfully.\nFile saved at " + dataDir);
}
}