Hi,
Document doc = new Document(MyDir + "in.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
var frmfields = doc.GetChildNodes(NodeType.FormField, true);
for (int i = 0; i < frmfields.Count; i++)
{
FormField frmfield = (FormField)frmfields[i];
if (i == 12)
{
var Line = new Aspose.Words.Drawing.Shape(doc, Aspose.Words.Drawing.ShapeType.Line);
Line.Width = 500;
Line.StrokeColor = Color.Red;
builder.MoveTo(frmfield.ParentParagraph);
builder.InsertNode(Line);
}
}
doc.Save(MyDir + "17.4.docx");
Document doc = new Document(MyDir + "in.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
var frmfields = doc.GetChildNodes(NodeType.FormField, true);
for (int i = 0; i < frmfields.Count; i++)
{
FormField frmfield = (FormField)frmfields[i];
if (i == 12)
{
Paragraph para = frmfield.ParentParagraph;
para.ParagraphFormat.Borders.Top.LineStyle = LineStyle.Single;
para.ParagraphFormat.Borders.Top.Color = Color.Red;
}
}
doc.Save(MyDir + "17.4.docx");