I want to add Dynamic text boxes by clicking a button and after it when i click another button it should use Replace function to change text in the word document with the text I write in the newly added Textbox(es). I use a Code which adds Textbox To the windows form but I'cant connect spire.doc doc.Replace() function to it See the code Below:
- Code: Select all
int A=1
private void button21_Click(object sender, EventArgs e)
{
AddNewTextBox();
}
public System.Windows.Forms.TextBox AddNewTextBox()
{
System.Windows.Forms.TextBox txt = new System.Windows.Forms.TextBox();
this.panel5.Controls.Add(txt);
txt.Top = A * 28;
txt.Left = 15;
txt.Name = "text" + this.A.ToString();
A = A + 1;
return txt;
}
Thank you very much.