You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System.IO;
using TemplateEngine.Docx;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
File.Delete("OutputDocument.docx");
File.Copy("InputTemplate.docx", "OutputDocument.docx");
var valuesToFill = new Content(
new RepeatContent("RepeatParentContent")
.AddItem(
new RepeatContent("RepeatChildrenContent").Hide()
.AddItem(new FieldContent("OrganizationName", "Рога и копыта")))
);
using (var outputDocument = new TemplateProcessor("OutputDocument.docx")
.SetRemoveContentControls(true))
{
outputDocument.FillContent(valuesToFill);
outputDocument.SaveChanges();
}
}
}
}
Activity