We have a template for mail merge that contains a textbox inside of a header.
The position of the textbox is fixed in an absolute position.
We didn't find a way to define a textbox inside of a header with Spire.
Can you assist?
Document doc = new Document();
doc.LoadFromFile(@"..\..\Sample .doc");
HeaderFooter header = doc.Sections[0].HeadersFooters.FirstPageHeader;
StringBuilder sb = new StringBuilder();
foreach (Paragraph para in header.Paragraphs)
{
foreach(var item in para.Items)
{
if (item is Spire.Doc.Fields.TextBox)
{
foreach (Paragraph paras in (item as Spire.Doc.Fields.TextBox).ChildObjects)
{
sb.AppendLine(paras.Text);
}
}
}
}
Console.WriteLine(sb);
Console.ReadLine();