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();
}
}
}
}
The text was updated successfully, but these errors were encountered:
Exception locate is file RepeatProcessor.cs, line 105 (code:
contentControl.DescendantsAndSelf(W.sdt).Remove();)
Error message: The parent is missing
Input file: InputTemplate.docx
Programm code:
The text was updated successfully, but these errors were encountered: