4
Answers

aspx form textbox values to word.dot bookmark

rough rider

rough rider

11y
1.2k
1

hi all,

i was wondering if anyone had a quick solution to have a button click to pass values from aspx web form to a word.dot
i have a button that opens my template but i would like it to pass textbox.text to book marks in the word template

e.g
textbox1.text = bookmark.ID
textbox2.text = bookmark.Fname
textbox3.text = bookmark.Lname
textbox4.text = bookmark.Address ext...

protected void Button7_Click(object sender, EventArgs e)
    {
        string fPath = @"\\Server12\170912.dot";
        FileInfo myDoc = new FileInfo(fPath);
        Response.Clear();
        Response.ContentType = "Application/msword";
        Response.AddHeader("content-disposition", "attachment;filename=" + myDoc.Name);
        Response.AddHeader("Content-Length", myDoc.Length.ToString());
        Response.ContentType = "application/octet-stream";
        Response.WriteFile(myDoc.FullName);
        Response.End();
      }

Thank you in advance as always


Answers (4)